Class: Hickory::LogSubscribers::ActionController

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/hickory/log_subscribers/action_controller.rb

Instance Method Summary collapse

Instance Method Details

#process_action(event) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/hickory/log_subscribers/action_controller.rb', line 4

def process_action(event)
  return if Hickory::Rails.ignore_if.present? && Hickory::Rails.ignore_if.call(event)

  payload = event.payload
  except_keys = %i[headers params path status view_runtime db_runtime]

   = payload.except(*except_keys).tap { |data|
    data.merge!(uri(payload))
    data.merge!(runtimes(event, payload))
    data.merge!(status(payload))
    data.merge!(params(payload))
  }

  logger.info("canonical-request #{payload[:method]} #{payload[:path]}", )
end