1Plack::Middleware::AcceUssseLrogC(o3n)tributed Perl DocuPmleanctka:t:iMoinddleware::AccessLog(3)
2
3
4
6 Plack::Middleware::AccessLog - Logs requests like Apache's log format
7
9 # in app.psgi
10 use Plack::Builder;
11
12 builder {
13 enable "Plack::Middleware::AccessLog", format => "combined";
14 $app;
15 };
16
18 Plack::Middleware::AccessLog forwards the request to the given app and
19 logs request and response details to the logger callback. The format
20 can be specified using Apache-like format strings (or "combined" or
21 "common" for the default formats). If none is specified "combined" is
22 used.
23
24 This middleware uses calculable content-length by checking body type,
25 and can not log the time taken to serve requests. It also logs the
26 request before the response is actually sent to the client. Use
27 Plack::Middleware::AccessLog::Timed if you want to log details after
28 the response is transmitted (more like a real web server) to the
29 client.
30
31 This middleware is enabled by default when you run plackup as a default
32 "development" environment.
33
35 format
36 enable "Plack::Middleware::AccessLog",
37 format => "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"";
38
39 Takes a format string (or a preset template "combined" or "custom")
40 to specify the log format. This middleware implements subset of
41 Apache's LogFormat templates.
42
43 logger
44 my $logger = Log::Dispatch->new(...);
45 enable "Plack::Middleware::AccessLog",
46 logger => sub { $logger->log(debug => @_) };
47
48 Sets a callback to print log message to. It prints to "psgi.errors"
49 output stream by default.
50
52 <http://httpd.apache.org/docs/2.2/mod/mod_log_config.html>
53 Rack::CustomLogger
54
55
56
57perl v5.12.3 2011-06-22 Plack::Middleware::AccessLog(3)