Skip to content

Instantly share code, notes, and snippets.

@tobiashm
Created January 15, 2013 21:12
Show Gist options
  • Save tobiashm/4542107 to your computer and use it in GitHub Desktop.
Save tobiashm/4542107 to your computer and use it in GitHub Desktop.
Capistrano task to tail server log
namespace :log do
desc "tail log file"
task :tail, :roles => :app do
run "tail -n 200 -f #{shared_path}/log/#{stage}.log" do |channel, stream, data|
trap("INT") { puts ' Log tailing finished'; exit 0; }
puts data
break if stream == :err
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment