diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-15 11:55:11 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-15 12:24:31 +0100 |
commit | 88dd60298ef393e2406ab543a1124a4304a19f61 (patch) | |
tree | ea7979db59c367dcda4a51306953039c6f85c932 /actionpack/lib/action_controller/railties | |
parent | 704daad76208f4581c8169e2cdca096ed804beb4 (diff) | |
download | rails-88dd60298ef393e2406ab543a1124a4304a19f61.tar.gz rails-88dd60298ef393e2406ab543a1124a4304a19f61.tar.bz2 rails-88dd60298ef393e2406ab543a1124a4304a19f61.zip |
Do not send the whole controller in notifications, cherry pick required pieces.
Diffstat (limited to 'actionpack/lib/action_controller/railties')
-rw-r--r-- | actionpack/lib/action_controller/railties/subscriber.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/railties/subscriber.rb b/actionpack/lib/action_controller/railties/subscriber.rb index 0556c6b40e..a9f5d16c58 100644 --- a/actionpack/lib/action_controller/railties/subscriber.rb +++ b/actionpack/lib/action_controller/railties/subscriber.rb @@ -2,22 +2,19 @@ module ActionController module Railties class Subscriber < Rails::Subscriber def process_action(event) - controller = event.payload[:controller] - request = controller.request + payload = event.payload - info "\nProcessed #{controller.class.name}##{event.payload[:action]} " \ - "to #{request.formats.join(', ')} (for #{request.remote_ip} at #{event.time.to_s(:db)}) " \ - "[#{request.method.to_s.upcase}]" + info "\nProcessed #{payload[:controller]}##{payload[:action]} " \ + "to #{payload[:formats].join(', ')} (for #{payload[:remote_ip]} at #{event.time.to_s(:db)}) " \ + "[#{payload[:method].to_s.upcase}]" - params = controller.send(:filter_parameters, request.params) - info " Parameters: #{params.inspect}" unless params.empty? + info " Parameters: #{payload[:params].inspect}" unless payload[:params].blank? - additions = ActionController::Base.log_process_action(controller) + additions = ActionController::Base.log_process_action(payload) message = "Completed in %.0fms" % event.duration message << " (#{additions.join(" | ")})" unless additions.blank? - message << " | #{controller.response.status}" - message << " [#{request.request_uri rescue "unknown"}]\n\n" + message << " | #{payload[:status]} [#{payload[:request_uri]}]\n\n" info(message) end |