class Fluent::Plugin::StdoutFilter

Constants

DEFAULT_FORMAT_TYPE

Attributes

formatter[R]

for tests

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method Fluent::PluginLoggerMixin#configure
# File lib/fluent/plugin/filter_stdout.rb, line 34
def configure(conf)
  compat_parameters_convert(conf, :inject, :formatter)
  super
  @formatter = formatter_create(conf: @config.elements('format').first, default_type: DEFAULT_FORMAT_TYPE)
end
filter_stream(tag, es) click to toggle source
# File lib/fluent/plugin/filter_stdout.rb, line 40
def filter_stream(tag, es)
  es.each { |time, record|
    begin
      r = inject_values_to_record(tag, time, record)
      log.write @formatter.format(tag, time, r)
    rescue => e
      router.emit_error_event(tag, time, record, e)
    end
  }
  log.flush
  es
end