Created
May 10, 2013 12:53
-
-
Save carlosipe/5554229 to your computer and use it in GitHub Desktop.
Capistrano - Tail log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "tail production log files" | |
task :tail_logs, :roles => :app do | |
trap("INT") { puts 'Interupted'; exit 0; } | |
run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| | |
puts # for an extra line break before the host name | |
puts "#{channel[:host]}: #{data}" | |
break if stream == :err | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install it in your shell instead of on each project:
http://streaming.nfm.id.au/getting-started-with-system-wide-capistrano-r/