Class: Fluent::Plugin::StdoutFormatter
Constant Summary
collapse
- TIME_FORMAT =
'%Y-%m-%d %H:%M:%S.%N %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
#acquire_worker_lock, #after_shutdown?, #after_start, #after_started?, #before_shutdown?, #called_in_test?, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #get_lock_path, #has_router?, #initialize, #inspect, #multi_workers_ready?, #plugin_root_dir, #reloadable_plugin?, #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
60
61
62
63
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 60
def after_shutdown
@sub_formatter.after_shutdown
super
end
|
#before_shutdown ⇒ Object
50
51
52
53
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 50
def before_shutdown
@sub_formatter.before_shutdown
super
end
|
#close ⇒ Object
65
66
67
68
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 65
def close
@sub_formatter.close
super
end
|
28
29
30
31
32
33
34
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 28
def configure(conf)
super
@time_formatter = Strftime.new(@time_format || TIME_FORMAT)
@sub_formatter = Plugin.new_formatter(@output_type, parent: self.owner)
@sub_formatter.configure(conf)
end
|
41
42
43
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 41
def format(tag, time, record)
"#{@time_formatter.exec(Time.at(time).localtime)} #{tag}: #{@sub_formatter.format(tag, time, record).chomp}\n"
end
|
#shutdown ⇒ Object
55
56
57
58
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 55
def shutdown
@sub_formatter.shutdown
super
end
|
#start ⇒ Object
36
37
38
39
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 36
def start
super
@sub_formatter.start
end
|
#stop ⇒ Object
45
46
47
48
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 45
def stop
@sub_formatter.stop
super
end
|
#terminate ⇒ Object
70
71
72
73
|
# File 'lib/fluent/plugin/formatter_stdout.rb', line 70
def terminate
@sub_formatter.terminate
super
end
|