Class: ScoutApm::Logging::Loggers::OpenTelemetry::SDK::Logs::Logger
- Inherits:
-
Logs::Logger
- Object
- Logs::Logger
- ScoutApm::Logging::Loggers::OpenTelemetry::SDK::Logs::Logger
- Defined in:
- lib/scout_apm/logging/loggers/opentelemetry/sdk/logs/logger.rb
Overview
The SDK implementation of OpenTelemetry::Logs::Logger
Instance Method Summary collapse
-
#initialize(name, version, logger_provider) ⇒ OpenTelemetry::SDK::Logs::Logger
constructor
private
Returns a new Logger instance.
-
#on_emit(timestamp: nil, observed_timestamp: Time.now, severity_text: nil, severity_number: nil, body: nil, attributes: nil, trace_id: nil, span_id: nil, trace_flags: nil, context: ::OpenTelemetry::Context.current) ⇒ Object
Emit a LogRecord to the processing pipeline.
Constructor Details
#initialize(name, version, logger_provider) ⇒ OpenTelemetry::SDK::Logs::Logger
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new ScoutApm::Logging::Loggers::OpenTelemetry::SDK::Logs::Logger instance. This should not be called directly. New loggers should be created using ScoutApm::Logging::Loggers::OpenTelemetry::SDK::Logs::LoggerProvider#logger.
27 28 29 30 |
# File 'lib/scout_apm/logging/loggers/opentelemetry/sdk/logs/logger.rb', line 27 def initialize(name, version, logger_provider) @instrumentation_scope = ::OpenTelemetry::SDK::InstrumentationScope.new(name, version) @logger_provider = logger_provider end |
Instance Method Details
#on_emit(timestamp: nil, observed_timestamp: Time.now, severity_text: nil, severity_number: nil, body: nil, attributes: nil, trace_id: nil, span_id: nil, trace_flags: nil, context: ::OpenTelemetry::Context.current) ⇒ Object
Emit a ScoutApm::Logging::Loggers::OpenTelemetry::SDK::Logs::LogRecord to the processing pipeline.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/scout_apm/logging/loggers/opentelemetry/sdk/logs/logger.rb', line 65 def on_emit(timestamp: nil, observed_timestamp: Time.now, severity_text: nil, severity_number: nil, body: nil, attributes: nil, trace_id: nil, span_id: nil, trace_flags: nil, context: ::OpenTelemetry::Context.current) @logger_provider.on_emit(timestamp: , observed_timestamp: , severity_text: severity_text, severity_number: severity_number, body: body, attributes: attributes, trace_id: nil, span_id: nil, trace_flags: nil, instrumentation_scope: @instrumentation_scope, context: context) end |