Class: Fluent::Plugin::BaritoTransport
- Inherits:
-
Object
- Object
- Fluent::Plugin::BaritoTransport
- Defined in:
- lib/fluent/plugin/barito_transport.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#produce_url ⇒ Object
Returns the value of attribute produce_url.
Instance Method Summary collapse
-
#initialize(produce_url, logger) ⇒ BaritoTransport
constructor
A new instance of BaritoTransport.
- #send(timber, header) ⇒ Object
Constructor Details
#initialize(produce_url, logger) ⇒ BaritoTransport
Returns a new instance of BaritoTransport.
7 8 9 10 |
# File 'lib/fluent/plugin/barito_transport.rb', line 7 def initialize(produce_url, logger) @produce_url = produce_url @logger = logger end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/fluent/plugin/barito_transport.rb', line 5 def logger @logger end |
#produce_url ⇒ Object
Returns the value of attribute produce_url.
5 6 7 |
# File 'lib/fluent/plugin/barito_transport.rb', line 5 def produce_url @produce_url end |
Instance Method Details
#send(timber, header) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/fluent/plugin/barito_transport.rb', line 12 def send(timber, header) begin RestClient.post @produce_url, timber.to_json, header rescue Exception => e @logger.error [e., e.response, header].join(', ') end end |