Class: ItamaeMitsurin::Handler::Fluentd
- Defined in:
- lib/itamae-mitsurin/handler/fluentd.rb
Instance Attribute Summary collapse
-
#fluent_logger ⇒ Object
for test.
Attributes inherited from Base
#actions, #recipes, #resources
Instance Method Summary collapse
- #event(type, payload = {}) ⇒ Object
-
#initialize ⇒ Fluentd
constructor
A new instance of Fluentd.
Constructor Details
#initialize ⇒ Fluentd
Returns a new instance of Fluentd.
6 7 8 9 |
# File 'lib/itamae-mitsurin/handler/fluentd.rb', line 6 def initialize(*) super load_fluent_logger end |
Instance Attribute Details
#fluent_logger ⇒ Object
for test
4 5 6 |
# File 'lib/itamae-mitsurin/handler/fluentd.rb', line 4 def fluent_logger @fluent_logger end |
Instance Method Details
#event(type, payload = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/itamae-mitsurin/handler/fluentd.rb', line 11 def event(type, payload = {}) super unless @fluent_logger.post(type, payload.merge(hostname: hostname)) ItamaeMitsurin.logger.warn "Sending logs to Fluentd failed: #{@fluent_logger.last_error}" end end |