Class: Rails::Rack::Logger

Inherits:
ActiveSupport::LogSubscriber show all
Defined in:
railties/lib/rails/rack/logger.rb

Overview

Log the request started and flush all loggers after it.

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

Methods inherited from ActiveSupport::LogSubscriber

attach_to, flush_all!, flushable_loggers, log_subscribers, logger

Constructor Details

#initialize(app) ⇒ Logger

Returns a new instance of Logger.



7
8
9
# File 'railties/lib/rails/rack/logger.rb', line 7

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
# File 'railties/lib/rails/rack/logger.rb', line 11

def call(env)
  before_dispatch(env)
  @app.call(env)
ensure
  after_dispatch(env)
end