The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Jifty::Plugin::AccessLog - Concisely log Jifty requests

DESCRIPTION

USAGE

Add the following to your site_config.yml

 framework:
   Plugins:
     - AccessLog: {}

OPTIONS

path

The file to log to; defaults to log/access_log.

respect_proxy

If set to a true value, will display the X-Forwarded-For header as the originating IP of requests.

format

The format string to use when logging. This module attempts to be as Apache-compatible as possible; it supports the following format escapes:

%%

The percent sign.

%a

Remote IP address.

%{Foobar}C

The contents of the cookie Foobar in the request sent to the server.

%D

The time taken to serve the request, in micoseconds.

%h

Remote IP address.

%{Foobar}n

The content of the Foobar header line(s) in the request.

%l

The first 8 characters of the session ID, if any.

%m

The request method.

%{Foobar}n

The value of the template or request argument Foobar, as sent by the client, or set in the dispatcher.

%{Foobar}o

The value of the Foobar header line(s) in the response.

%p

The canonical port of the server serving the request. Alternate forms include %{canonical}p, %{local}p, and %{remote}p, which are the respective connection ports.

%P

The process ID that serviced the request.

%s

The status code of the response.

%t

The time the request was recieved, formatted in Apache's default format string ([%d/%b/%Y:%T %z]). %{format}t can be used to provide a strftime-style custom format.

%T

The time taken to serve the request, in seconds.

%u

The value of "username" in Jifty::CurrentUser, if any.

%U

The path requested. In the event that the request was for one or more regions, the list of regions will be given in square brackets.

%v

The canonical server name of the server.

%x

The list of active actions run in the request. Failed actions will be followed with an exclamation mark, un-run actions with a tilde.

%X

As %X, but also includes all argument values to each action.

METHODS

init

Installs the trigger for each request.

new_request

On each request, log when it starts.

before_cleanup

Open, and append to, the logfile with the format specified.

SEE ALSO

Jifty::Plugin::Recorder for more verbose debugging information.

COPYRIGHT AND LICENSE

Copyright 2009 Best Practical Solutions

This is free software and may be modified and distributed under the same terms as Perl itself.