Class: Rack::ErrorLogger
- Inherits:
-
RackLogger
- Object
- RackLogger
- Rack::ErrorLogger
- Defined in:
- lib/simple_rack_logger/error_logger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, logger, *filters) ⇒ ErrorLogger
constructor
A new instance of ErrorLogger.
Methods inherited from RackLogger
Constructor Details
#initialize(app, logger, *filters) ⇒ ErrorLogger
Returns a new instance of ErrorLogger.
7 8 9 |
# File 'lib/simple_rack_logger/error_logger.rb', line 7 def initialize(app, logger, *filters) super end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/simple_rack_logger/error_logger.rb', line 5 def logger @logger end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/simple_rack_logger/error_logger.rb', line 11 def call(env) begin @app.call(env) rescue => e logger.error("#{e.}\r\n#{e.backtrace.join("\r\n")}") logger.flush raise e end end |