Class: Padrino::Logger::Rack
- Inherits:
-
Object
- Object
- Padrino::Logger::Rack
- Defined in:
- lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/logger.rb
Overview
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.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, uri_root) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app, uri_root) ⇒ Rack
Returns a new instance of Rack.
397 398 399 400 |
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/logger.rb', line 397 def initialize(app, uri_root) # @private @app = app @uri_root = uri_root.sub(/\/$/,"") end |
Instance Method Details
#call(env) ⇒ Object
402 403 404 405 406 407 408 |
# File 'lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/logger.rb', line 402 def call(env) # @private env['rack.logger'] = Padrino.logger began_at = Time.now status, header, body = @app.call(env) log(env, status, header, began_at) [status, header, body] end |