Class: Rails::Rack::Logger
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- Rails::Rack::Logger
- Defined in:
- railties/lib/rails/rack/logger.rb
Overview
Log the request started and flush all loggers after it.
Constant Summary
Constant Summary
Constants inherited from ActiveSupport::LogSubscriber
ActiveSupport::LogSubscriber::BLACK, ActiveSupport::LogSubscriber::BLUE, ActiveSupport::LogSubscriber::BOLD, ActiveSupport::LogSubscriber::CLEAR, ActiveSupport::LogSubscriber::CYAN, ActiveSupport::LogSubscriber::GREEN, ActiveSupport::LogSubscriber::MAGENTA, ActiveSupport::LogSubscriber::RED, ActiveSupport::LogSubscriber::WHITE, ActiveSupport::LogSubscriber::YELLOW
Instance Method Summary (collapse)
- - (Object) call(env)
-
- (Logger) initialize(app, tags = nil)
constructor
A new instance of Logger.
Methods inherited from ActiveSupport::LogSubscriber
attach_to, flush_all!, flushable_loggers, log_subscribers, logger
Constructor Details
- (Logger) initialize(app, tags = nil)
A new instance of Logger
8 9 10 |
# File 'railties/lib/rails/rack/logger.rb', line 8 def initialize(app, =nil) @app, @tags = app, .presence end |
Instance Method Details
- (Object) call(env)
12 13 14 15 16 17 18 |
# File 'railties/lib/rails/rack/logger.rb', line 12 def call(env) if @tags Rails.logger.tagged((env)) { call_app(env) } else call_app(env) end end |