Skip to content

Instantly share code, notes, and snippets.

@mm53bar
Created November 4, 2011 14:40
Show Gist options
  • Select an option

  • Save mm53bar/1339472 to your computer and use it in GitHub Desktop.

Select an option

Save mm53bar/1339472 to your computer and use it in GitHub Desktop.
Log your servers with Capistrano
require File.join(File.dirname(__FILE__), 'deploy/log')
# ....
# insert the rest of your capistrano script here
# from https://github.com/webficient/capistrano-recipes/blob/master/lib/recipes/log.rb
Capistrano::Configuration.instance.load do
namespace :log do
desc "Tail all application log files"
task :tail, :roles => :app do
run "tail -f #{current_path}/log/*.log" do |channel, stream, data|
puts "#{channel[:host]}: #{data}"
break if stream == :err
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment