aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/instrumentation.rb8
-rw-r--r--actionpack/lib/action_controller/railties/subscriber.rb3
2 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/instrumentation.rb b/actionpack/lib/action_controller/metal/instrumentation.rb
index 91d454f0c3..e0c75c9e44 100644
--- a/actionpack/lib/action_controller/metal/instrumentation.rb
+++ b/actionpack/lib/action_controller/metal/instrumentation.rb
@@ -66,11 +66,13 @@ module ActionController
module ClassMethods
# A hook which allows other frameworks to log what happened during
- # controller process action.
+ # controller process action. This method should return an awway
+ # with the messages to be added.
# :api: plugin
def log_process_action(controller) #:nodoc:
- view_runtime = controller.send :view_runtime
- logger.info(" View runtime: %.1fms" % view_runtime.to_f) if view_runtime
+ messages, view_runtime = [], controller.send(:view_runtime)
+ messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime
+ messages
end
end
end
diff --git a/actionpack/lib/action_controller/railties/subscriber.rb b/actionpack/lib/action_controller/railties/subscriber.rb
index d6a71afc23..c21305ac8f 100644
--- a/actionpack/lib/action_controller/railties/subscriber.rb
+++ b/actionpack/lib/action_controller/railties/subscriber.rb
@@ -12,9 +12,10 @@ module ActionController
params = controller.send(:filter_parameters, request.params)
info " Parameters: #{params.inspect}" unless params.empty?
- ActionController::Base.log_process_action(controller)
+ additions = ActionController::Base.log_process_action(controller)
message = "Completed in %.0fms" % event.duration
+ message << " (#{additions.join(" | ")})" unless additions.blank?
message << " | #{controller.response.status}"
message << " [#{request.request_uri rescue "unknown"}]\n\n"