Class: Logged::Formatter::Logstash
- Defined in:
- lib/logged/formatter/logstash.rb
Overview
Logstash formatter for logged
Instance Method Summary collapse
- #call(data) ⇒ Object
-
#initialize(message_formatter = nil) ⇒ Logstash
constructor
A new instance of Logstash.
Constructor Details
#initialize(message_formatter = nil) ⇒ Logstash
Returns a new instance of Logstash.
10 11 12 |
# File 'lib/logged/formatter/logstash.rb', line 10 def initialize( = nil) = || KeyValue.new end |
Instance Method Details
#call(data) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/logged/formatter/logstash.rb', line 14 def call(data) load_dependencies event = LogStash::Event.new(data) event[:message] ||= .call(data) event.to_json end |