class SemanticLogger::Formatters::Fluentd

Fluentd is similar to SemanticLogger::Formatters::Json but with log levels that are recognized by kubernetes fluentd.

Attributes

need_process_info[R]

Public Class Methods

new(time_format: :rfc_3339, time_key: :time, need_process_info: false, **args) click to toggle source
Calls superclass method
# File lib/semantic_logger/formatters/fluentd.rb, line 10
def initialize(time_format: :rfc_3339, time_key: :time, need_process_info: false, **args)
  @need_process_info = need_process_info
  super(time_format: time_format, time_key: time_key, **args)
end

Public Instance Methods

level() click to toggle source
# File lib/semantic_logger/formatters/fluentd.rb, line 15
def level
  hash["severity"]       = log.level
  hash["severity_index"] = log.level_index
end
process_info() click to toggle source
Calls superclass method
# File lib/semantic_logger/formatters/fluentd.rb, line 20
def process_info
  # Ignore fields: pid, thread, file and line by default
  super() if need_process_info
end