Module: Log::ControllerSupport
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/log/controller_support.rb
Instance Method Summary collapse
Instance Method Details
#clear_log_context ⇒ Object
33 34 35 |
# File 'lib/log/controller_support.rb', line 33 def clear_log_context Log.clear_context end |
#handle_unverified_request_with_log ⇒ Object
37 38 39 40 |
# File 'lib/log/controller_support.rb', line 37 def handle_unverified_request_with_log Log.warn("Can't verify CSRF token authenticity") handle_unverified_request_without_log end |
#set_log_context ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/log/controller_support.rb', line 14 def set_log_context context = {} context.merge!( :url => request.url, :user_agent => request.user_agent, :ip => request.ip, :remote_ip => request.remote_ip, :referer => request.referer, :environment => Rails.env.to_s, :session_id => request.[:id], :session => request.session, :params => params ) context.merge!(:current_user => current_user.try(:id)) if respond_to? :current_user context.merge!(more_context) if respond_to? :more_context Log.clear_context Log.context(context) end |