AccessLog provides logging to various files in various formats.

Multiple logs may be written to at the same time:

access_log = [
  [$stderr, WEBrick::AccessLog::COMMON_LOG_FORMAT],
  [$stderr, WEBrick::AccessLog::REFERER_LOG_FORMAT],
]

server = WEBrick::HTTPServer.new :AccessLog => access_log

Custom log formats may be defined. WEBrick::AccessLog provides a subset of the formatting from Apache’s mod_log_config http://httpd.apache.org/docs/mod/mod_log_config.html#formats. See AccessLog::setup_params for a list of supported options

Constants

CLF_TIME_FORMAT = "[%d/%b/%Y:%H:%M:%S %Z]"

COMMON_LOG_FORMAT = "%h %l %u %t \"%r\" %s %b"

CLF = COMMON_LOG_FORMAT

REFERER_LOG_FORMAT = "%{Referer}i -> %U"

AGENT_LOG_FORMAT = "%{User-Agent}i"

COMBINED_LOG_FORMAT = "#{CLF} \"%{Referer}i\" \"%{User-agent}i\""

Attributes

Show files where this module is defined (1 file)
Register or log in to add new notes.