Skip to content

Instantly share code, notes, and snippets.

View duksis's full-sized avatar
🇪🇺
I definitely will be slow to respond.

Hugo Duksis duksis

🇪🇺
I definitely will be slow to respond.
View GitHub Profile
@duksis
duksis / log.rb
Created November 26, 2012 16:03 — forked from tmikoss/log.rb
Capistrano recipes for remote log viewing
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}"