Class: SemanticLogger::Formatters::OpenTelemetry
- Defined in:
- lib/semantic_logger/formatters/open_telemetry.rb
Constant Summary collapse
- PRIMS =
primitives allowed by OTLP logs in Ruby: String, Integer, Float, TrueClass, FalseClass
[String, Integer, Float, TrueClass, FalseClass].freeze
Instance Attribute Summary
Attributes inherited from Raw
Attributes inherited from Base
Instance Method Summary collapse
-
#level ⇒ Object
Log level.
-
#payload ⇒ Object
Payload is submitted directly as attributes.
Methods inherited from Raw
#application, #call, #duration, #environment, #exception, #file_name_and_line, #host, #initialize, #message, #metric, #name, #named_tags, #pid, #tags, #thread_name, #time
Methods inherited from Base
#backtrace, #fast_tag, #level=, #log, #measure, #named_tags, #pop_tags, #push_tags, #should_log?, #silence, #tagged, #tags, #with_level
Constructor Details
This class inherits a constructor from SemanticLogger::Formatters::Raw
Instance Method Details
#level ⇒ Object
Log level
9 10 11 12 |
# File 'lib/semantic_logger/formatters/open_telemetry.rb', line 9 def level hash[:level] = log.level.to_s hash[:level_index] = severity_number(log.level_index) end |
#payload ⇒ Object
Payload is submitted directly as attributes
15 16 17 18 19 |
# File 'lib/semantic_logger/formatters/open_telemetry.rb', line 15 def payload return unless log.payload.respond_to?(:empty?) && !log.payload.empty? hash[:payload] = coerce_map(log.payload) end |