Class: Padrino::Logger::Rack

### Home Classes Methods

### In Files

- lib/padrino-core/logger.rb

### Parent

Object

### Methods

- ::new
- #call

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetup
- Padrino::ApplicationSetup::ClassMethods
- Padrino::AuthenticityToken
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Cli::Launcher
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Loader
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::ApplicationWrapper
- Padrino::Mounter::MounterException
- Padrino::ParamsProtection
- Padrino::ParamsProtection::ClassMethods
- Padrino::ParamsProtection::InstanceMethods
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Reloader::Storage
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::Path
- HttpRouter::Node::SpanningRegex
- HttpRouter::Request
- HttpRouter::Route
- Sinatra
- Sinatra::Base
- Sinatra::Request
- Kernel
- Object
- PadrinoTasks

No matching classes.

# Padrino::Logger::Rack

Padrino::Logger::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 412
    def initialize(app, uri_root)
      @app = app
      @uri_root = uri_root.sub(/\/$/,"")
    end

### Public Instance Methods

call(env) click to toggle source

    # File lib/padrino-core/logger.rb, line 417
    def call(env)
      env['rack.logger'] = Padrino.logger
      began_at = Time.now
      status, header, body = @app.call(env)
      log(env, status, header, began_at) if logger.debug?
      [status, header, body]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.