Sha256: b054200e6f6e096f3a7a865e2514c19b4654db16c4047c32df6aa4a29c294cd9

Contents?: true

Size: 866 Bytes

Versions: 17

Compression:

Stored size: 866 Bytes

Contents

# patch the actioncontroller logsubscriber to set the action on the logjam logger as soon as it starts processing the request
require 'action_controller/metal/instrumentation'
require 'action_controller/log_subscriber'

module ActionController #:nodoc:

  class LogSubscriber
    def start_processing(event)
      payload = event.payload
      params  = payload[:params].except(*INTERNAL_PARAMS)
      format  = payload[:format]
      format  = format.to_s.upcase if format.is_a?(Symbol)

      controller = payload[:controller]
      action = payload[:action]
      full_name = "#{controller}##{action}"
      action_name = LogjamAgent.action_name_proc.call(full_name)

      LogjamAgent.request.fields[:action] = action_name

      info "Processing by #{full_name} as #{format}"
      info "  Parameters: #{params.inspect}" unless params.empty?
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
logjam_agent-0.36.0 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.35.1 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.35.0 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.34.3 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.34.2 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.34.1 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.34.0 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.33.3 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.33.2 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.33.1 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.33.0 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.32.4 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.32.3 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.32.2 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.32.1 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.32.0 lib/logjam_agent/rack/rails_support.rb
logjam_agent-0.31.0 lib/logjam_agent/rack/rails_support.rb