Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Tail Multiple Log Files At Once With Capistrano (See related posts)

From http://errtheblog.com/post/21
Allows you to aggregate the tailing of multiple production log files with one Capistrano task

Stick it in deploy.rb:
desc "tail production log files" 
task :tail_logs, :roles => :app do
  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

You need to create an account or log in to post comments to this site.


Click here to browse all 4860 code snippets

Related Posts