diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-01 15:46:30 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-01 15:46:30 +0100 |
commit | 62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56 (patch) | |
tree | 0e8f8cabcb0ddf66be58fa3a4697b303128de0ea /actionpack/lib/action_controller | |
parent | fbe387ea257ffbbf8689f333512aa7ef0628f3d2 (diff) | |
download | rails-62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56.tar.gz rails-62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56.tar.bz2 rails-62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56.zip |
Simplified the logging format for parameters (don't include controller, action, and format as duplicates) [DHH]
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 6756ddd0a4..74c04147fb 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1225,17 +1225,34 @@ module ActionController #:nodoc: def log_processing if logger && logger.info? - logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" + log_processing_for_request_id + log_processing_for_session_id + log_processing_for_parameters + end + end + + def log_processing_for_request_id + request_id = "\n\nProcessing #{self.class.name}\##{action_name} " + request_id << "to #{params[:format]} " if params[:format] + request_id << "(for #{request_origin}) [#{request.method.to_s.upcase}]" - if @_session && @_session.respond_to?(:session_id) && - !(@_session.respond_to?(:dbman) && @_session.is_a?(CGI::Session::CookieStore)) - logger.info " Session ID: #{@_session.session_id}" - end + logger.info(request_id) + end - logger.info " Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}" + def log_processing_for_session_id + if @_session && @_session.respond_to?(:session_id) && @_session.respond_to?(:dbman) && + !@_session.dbman.is_a?(CGI::Session::CookieStore) + logger.info " Session ID: #{@_session.session_id}" end end + def log_processing_for_parameters + parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params + parameters = parameters.except(:controller, :action, :format) + + logger.info " Parameters: #{parameters.inspect}" + end + def default_render #:nodoc: render end |