Class: HTTParty::Logger::LogstashFormatter
- Inherits:
-
Object
- Object
- HTTParty::Logger::LogstashFormatter
- Defined in:
- lib/httparty/logger/logstash_formatter.rb
Overview
:nodoc:
Constant Summary collapse
- TAG_NAME =
HTTParty.name
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #format(request, response) ⇒ Object
-
#initialize(logger, level) ⇒ LogstashFormatter
constructor
A new instance of LogstashFormatter.
Constructor Details
#initialize(logger, level) ⇒ LogstashFormatter
Returns a new instance of LogstashFormatter.
10 11 12 13 |
# File 'lib/httparty/logger/logstash_formatter.rb', line 10 def initialize(logger, level) @logger = logger @level = level.to_sym end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
8 9 10 |
# File 'lib/httparty/logger/logstash_formatter.rb', line 8 def level @level end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/httparty/logger/logstash_formatter.rb', line 8 def logger @logger end |
Instance Method Details
#format(request, response) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/httparty/logger/logstash_formatter.rb', line 15 def format(request, response) @request = request @response = response logger.public_send level, end |