Parent

Methods

Files

Padrino::Logger::Rack

Padrino::Loggger::Rack forwards every request to an app given, and logs a line in the Apache common log format to the logger, or rack.errors by default.

Public Class Methods

new(app, uri_root) click to toggle source
# File lib/padrino-core/logger.rb, line 297
def initialize(app, uri_root) # @private
  @app = app
  @uri_root = uri_root.sub(/\/$/,"")
end

Public Instance Methods

call(env) click to toggle source
# File lib/padrino-core/logger.rb, line 302
def call(env) # @private
  env['rack.logger'] = Padrino.logger
  env['rack.errors'] = Padrino.logger.log
  began_at = Time.now
  status, header, body = @app.call(env)
  log(env, status, header, began_at)
  [status, header, body]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.