Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:rubber/rubber

  • Loading branch information...
commit fbba7ecb1d6e70fd53d25880719358564d51f6a7 2 parents 336e530 + fdd2b34
@nirvdrum nirvdrum authored
View
10 lib/rubber/recipes/rubber/utils.rb
@@ -59,13 +59,17 @@
desc <<-DESC
Live tail of rails log files for all machines
By default tails the rails logs for the current RUBBER_ENV, but one can
- set FILE=/path/file.*.glob to tails a different set
+ set FILE=/path/file.*.glob to tail a different set
DESC
task :tail_logs, :roles => :app do
+ last_host = ""
log_file_glob = rubber.get_env("FILE", "Log files to tail", true, "#{current_path}/log/#{Rubber.env}*.log")
+ trap("INT") { puts 'Exiting...'; exit 0; } # handle ctrl-c gracefully
run "tail -qf #{log_file_glob}" do |channel, stream, data|
- puts # for an extra line break before the host name
- puts data
+ puts if channel[:host] != last_host # blank line between different hosts
+ host = "[#{channel.properties[:host].gsub(/\..*/, '')}]" # get left-most subdomain
+ data.lines { |line| puts "%-15s %s" % [host, line] } # add host name to the start of each line
+ last_host = channel[:host]
break if stream == :err
end
end
View
2  templates/torquebox/config/rubber/deploy-torquebox.rb
@@ -105,8 +105,6 @@
rsudo "service torquebox status || service torquebox start"
end
- after "deploy:restart", "rubber:torquebox:reload"
-
desc "Reloads the apache web server"
task :reload, :roles => :torquebox do
serial_reload
Please sign in to comment.
Something went wrong with that request. Please try again.