Class: ElasticLogger::ElkWriter
- Inherits:
-
Object
- Object
- ElasticLogger::ElkWriter
- Defined in:
- lib/elastic-logger/elk_writer.rb
Instance Method Summary collapse
-
#initialize(name:, config:) ⇒ ElkWriter
constructor
A new instance of ElkWriter.
- #log(severity, hash) ⇒ Object
Constructor Details
#initialize(name:, config:) ⇒ ElkWriter
5 6 7 8 |
# File 'lib/elastic-logger/elk_writer.rb', line 5 def initialize(name:, config:) @config = config @name = name end |
Instance Method Details
#log(severity, hash) ⇒ Object
10 11 12 |
# File 'lib/elastic-logger/elk_writer.rb', line 10 def log(severity, hash) client.index(index: index, type: name, body: build_log(severity, hash)) end |