Module: DHS::Interceptors::ExtendedRollbar::Handler::ExtendedLogging

Included in:
Rollbar::Notifier
Defined in:
lib/dhs/interceptors/extended_rollbar/handler.rb

Instance Method Summary collapse

Instance Method Details

#log(level, *args) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dhs/interceptors/extended_rollbar/handler.rb', line 17

def log(level, *args)
  args[2] = {} if args[2].nil?
  args[2][:dhs] = DHS::Interceptors::ExtendedRollbar::ThreadRegistry.log.map do |entry|
    {
      request: entry[:request].options,
      response: {
        code: entry[:response].code,
        body: entry[:response].body
      }
    }
  end.to_json
  super
end