Skip to content

Instantly share code, notes, and snippets.

@ciniglio
Created June 25, 2013 18:49
Show Gist options
  • Save ciniglio/5861204 to your computer and use it in GitHub Desktop.
Save ciniglio/5861204 to your computer and use it in GitHub Desktop.
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