diff options
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 |