Class: Rails::Rack::Logger

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

Overview

Log the request started and flush all loggers after it.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Logger

Returns a new instance of Logger.


7
8
9
# File '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 'lib/rails/rack/logger.rb', line 11

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