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

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

Defined Under Namespace

Modules: Chain, Prepend

Constant Summary collapse

INSTRUMENTATION_NAME =
NewRelic::Agent.base_name(name)

Instance Method Summary collapse

Instance Method Details

#broadcast_with_tracing(logger) ⇒ Object

Mark @skip_instrumenting on any broadcasted loggers to instrument Rails.logger only



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

def broadcast_with_tracing(logger)
  NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)

  NewRelic::Agent::Instrumentation::Logger.mark_skip_instrumenting(logger)
  yield
rescue => error
  NewRelic::Agent.notice_error(error)
  raise
end