From 62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 1 Nov 2008 15:46:30 +0100 Subject: Simplified the logging format for parameters (don't include controller, action, and format as duplicates) [DHH] --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_controller/base.rb | 29 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 9b977f1377..17fada156d 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *2.2.1 [RC2 or 2.2 final]* +* Simplified the logging format for parameters (don't include controller, action, and format as duplicates) [DHH] + * Remove the logging of the Session ID when the session store is CookieStore [DHH] * Fixed regex in redirect_to to fully support URI schemes #1247 [Seth Fitzsimmons] 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 -- cgit v1.2.3