Skip to content
Browse files

Adding recipe for tailing rails production logs

  • Loading branch information...
1 parent 6595375 commit 460e64918539264cd03614604ed53fb04895e444 @cwsaylor cwsaylor committed Apr 2, 2012
Showing with 11 additions and 0 deletions.
  1. +1 −0 lib/cap_bootstrap/capistrano.rb
  2. +10 −0 lib/cap_bootstrap/recipes/utilities.rb
View
1 lib/cap_bootstrap/capistrano.rb
@@ -5,3 +5,4 @@
require 'cap_bootstrap/recipes/postgresql'
require 'cap_bootstrap/recipes/rbenv'
require 'cap_bootstrap/recipes/unicorn'
+require 'cap_bootstrap/recipes/utilities'
View
10 lib/cap_bootstrap/recipes/utilities.rb
@@ -0,0 +1,10 @@
+Capistrano::Configuration.instance(:must_exist).load do
+ 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
+end

0 comments on commit 460e649

Please sign in to comment.
Something went wrong with that request. Please try again.