Module: OpenTelemetry::Instrumentation::Logger::Patches::Logger

Defined in:
lib/opentelemetry/instrumentation/logger/patches/logger.rb

Overview

Instrumentation for methods from Ruby's Logger class

Constant Summary collapse

IN_OTEL_EMIT_KEY =
:in_otel_emit

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#skip_otel_emit=(value) ⇒ Object (writeonly)

Sets the attribute skip_otel_emit

Parameters:

  • value

    the value to set the attribute skip_otel_emit to.



15
16
17
# File 'lib/opentelemetry/instrumentation/logger/patches/logger.rb', line 15

def skip_otel_emit=(value)
  @skip_otel_emit = value
end

Instance Method Details

#format_message(severity, datetime, progname, msg) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/opentelemetry/instrumentation/logger/patches/logger.rb', line 17

def format_message(severity, datetime, progname, msg)
  formatted_message = super

  emit_to_otel(severity, datetime, formatted_message)

  formatted_message
end