Class: Fluent::Plugin::StdoutFormatter
Constant Summary
collapse
- TIME_FORMAT =
'%Y-%m-%d %H:%M:%S.%9N %z'
Constants inherited
from Formatter
Formatter::PARSER_TYPES
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes inherited from Base
#under_plugin_development
Instance Method Summary
collapse
Methods inherited from Formatter
#formatter_type
included, #time_formatter_create
#log, #owner, #owner=
Methods inherited from Base
#after_shutdown?, #after_start, #after_started?, #before_shutdown?, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #has_router?, #initialize, #inspect, #multi_workers_ready?, #plugin_root_dir, #shutdown?, #started?, #stopped?, #string_safe_encoding, #terminated?
#system_config, #system_config_override
#config, #configure_proxy_generate, #configured_section_create, included, #initialize, lookup_type, register_type
Instance Method Details
#after_shutdown ⇒ Object
59
60
61
62
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 59
def after_shutdown
@sub_formatter.after_shutdown
super
end
|
#before_shutdown ⇒ Object
49
50
51
52
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 49
def before_shutdown
@sub_formatter.before_shutdown
super
end
|
#close ⇒ Object
64
65
66
67
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 64
def close
@sub_formatter.close
super
end
|
28
29
30
31
32
33
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 28
def configure(conf)
super
@sub_formatter = Plugin.new_formatter(@output_type, parent: self.owner)
@sub_formatter.configure(conf)
end
|
40
41
42
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 40
def format(tag, time, record)
"#{Time.at(time).localtime.strftime(TIME_FORMAT)} #{tag}: #{@sub_formatter.format(tag, time, record).chomp}\n"
end
|
#shutdown ⇒ Object
54
55
56
57
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 54
def shutdown
@sub_formatter.shutdown
super
end
|
#start ⇒ Object
35
36
37
38
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 35
def start
super
@sub_formatter.start
end
|
#stop ⇒ Object
44
45
46
47
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 44
def stop
@sub_formatter.stop
super
end
|
#terminate ⇒ Object
69
70
71
72
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 69
def terminate
@sub_formatter.terminate
super
end
|