Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplified the logging format for parameters (don't include controlle…

…r, action, and format as duplicates) [DHH]
  • Loading branch information...
commit 62ffc6e4db1eecfe5c5a5f7471a9c39d665ada56 1 parent fbe387e
@dhh dhh authored
Showing with 25 additions and 6 deletions.
  1. +2 −0  actionpack/CHANGELOG
  2. +23 −6 actionpack/lib/action_controller/base.rb
View
2  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]
View
29 actionpack/lib/action_controller/base.rb
@@ -1225,17 +1225,34 @@ def initialize_current_url
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
Please sign in to comment.
Something went wrong with that request. Please try again.