Parent

Methods

Class/Module Index [+]

Quicksearch

Rack::SyslogLogger

Rack::CommonLogger 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.

Constants

FORMAT

Common Log Format: httpd.apache.org/docs/1.3/logs.html#common lilith.local - - [07/Aug/2006 23:58:02] "GET / HTTP/1.1" 500 -

%{%s - %s [%s] "%s %s%s %s" %d %s\n} %

Public Class Methods

new(app, logger=nil) click to toggle source
# File lib/sinatra/rack_syslog.rb, line 41
def initialize(app, logger=nil)
  @app = app
  @logger = logger || $stdout
end

Public Instance Methods

call(env) click to toggle source
# File lib/sinatra/rack_syslog.rb, line 46
def call(env)
  began_at = Time.now
  status, header, body = @app.call(env)
  header = Utils::HeaderHash.new(header)
  body = Rack::BodyProxy.new(body) { log(env, status, header, began_at) }
  [status, header, body]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.