Class: Ezlog::Rails::RequestLogContext
- Inherits:
-
Object
- Object
- Ezlog::Rails::RequestLogContext
- Includes:
- LogContextHelper
- Defined in:
- lib/ezlog/rails/request_log_context.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestLogContext
constructor
A new instance of RequestLogContext.
Methods included from LogContextHelper
#add_to_log_context, #within_log_context
Constructor Details
#initialize(app) ⇒ RequestLogContext
Returns a new instance of RequestLogContext.
6 7 8 |
# File 'lib/ezlog/rails/request_log_context.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 |
# File 'lib/ezlog/rails/request_log_context.rb', line 10 def call(env) within_log_context request_id: env['action_dispatch.request_id'] do @app.call(env) end end |