1Plack::Middleware::AcceUssseLrogC:o:nTtirmiebdu(t3e)d PePrllacDko:c:uMmiedndtlaetwiaorne::AccessLog::Timed(3)
2
3
4
6 Plack::Middleware::AccessLog::Timed - Logs requests with time and
7 accurate body size
8
10 # in app.psgi
11 use Plack::Builder;
12
13 builder {
14 enable "Plack::Middleware::AccessLog::Timed",
15 format => "%v %h %l %u %t \"%r\" %>s %b %D";
16 $app;
17 };
18
20 Plack::Middleware::AccessLog::Timed is a subclass of
21 Plack::Middleware::AccessLog but uses a wrapped body handle to get the
22 actual response body size %b (even if it's not a chunk of array or a
23 real filehandle) and the time taken to serve the request: %T or %D.
24
25 This wraps the response body output stream to capture the time taken
26 for the PSGI server to read the whole response body.
27
28 This would mean, if the middleware is in use, it will prevent some
29 server-side optimizations like sendfile(2) from working, as well as
30 middleware like Plack::Middleware::ContentLength can't guess the body
31 size out of the file handle.
32
33 If all you want is to capture the time taken in your PSGI application
34 and do not want the wrapped body behavior described above, consider
35 instead applying Plack::Middleware::Runtime and using
36 Plack::Middleware::AccessLog to log the "X-Runtime" header.
37
39 Same as Plack::Middleware::AccessLog.
40
42 Tatsuhiko Miyagawa
43
45 Plack::Middleware::AccessLog
46
47 Plack::Middleware::Runtime
48
49
50
51perl v5.38.0 2023-07P-l2a1ck::Middleware::AccessLog::Timed(3)