Class: Fluent::StdoutFilter
- Defined in:
- lib/fluent/plugin/filter_stdout.rb
Constant Summary
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
for tests.
Attributes inherited from Filter
Attributes included from PluginLoggerMixin
Instance Method Summary collapse
-
#configure(conf) ⇒ Object
config_param :output_type, :string, :default => ‘json’ (StdoutFormatter defines this).
- #filter_stream(tag, es) ⇒ Object
Methods inherited from Filter
#filter, #initialize, #shutdown, #start
Methods included from PluginLoggerMixin
Methods included from PluginId
Methods included from Configurable
#config, included, #initialize, lookup_type, register_type
Constructor Details
This class inherits a constructor from Fluent::Filter
Instance Attribute Details
#formatter ⇒ Object (readonly)
for tests
25 26 27 |
# File 'lib/fluent/plugin/filter_stdout.rb', line 25 def formatter @formatter end |
Instance Method Details
#configure(conf) ⇒ Object
config_param :output_type, :string, :default => ‘json’ (StdoutFormatter defines this)
31 32 33 34 35 36 |
# File 'lib/fluent/plugin/filter_stdout.rb', line 31 def configure(conf) super @formatter = Plugin.new_formatter(@format) @formatter.configure(conf) end |
#filter_stream(tag, es) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/fluent/plugin/filter_stdout.rb', line 38 def filter_stream(tag, es) es.each { |time, record| begin log.write @formatter.format(tag, time, record) rescue => e router.emit_error_event(tag, time, record, e) end } log.flush es end |