Module: NewRelic::Agent::Instrumentation::ActiveSupportLogger::Chain

Defined in:
lib/new_relic/agent/instrumentation/active_support_logger/chain.rb

Instance Method Summary collapse

Instance Method Details

#instrument!Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/new_relic/agent/instrumentation/active_support_logger/chain.rb', line 8

def instrument!
  ::ActiveSupport::Logger.module_eval do
    include NewRelic::Agent::Instrumentation::ActiveSupportLogger
    def broadcast_with_new_relic(logger)
      broadcast_with_tracing(logger) {
        broadcast_without_newrelic(logger)
      }
    end

    alias broadcast_without_newrelic broadcast
    alias broadcast broadcast_with_new_relic
  end
end