Created
November 16, 2012 07:06
Revisions
-
tmikoss created this gist
Nov 16, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ namespace :log do desc "Search from log files on server" task :grep, :roles => :app do run "cd #{current_path}/log && grep #{ENV['str']} -B #{ENV['before'] || 5} -A #{ENV['after'] || 35} #{rails_env}.log*" end desc "Tail log files on servers" task :tail, :roles => :app do run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data| puts "#{data}" break if stream == :err end end end