Module: NewRelic::Agent::Logging::Chain

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

Class Method Summary collapse

Class Method Details

.instrument!Object



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

def self.instrument!
  ::Logging::Logger.class_eval do
    include NewRelic::Agent::Instrumentation::Logging::Logger

    alias_method(:log_event_without_new_relic, :log_event)

    def log_event(event)
      log_event_with_new_relic(event) do
        log_event_without_new_relic(event)
      end
    end
  end
end