Custom fields in Plack AccessLog middleware
https://metacpan.org/pod/Plack::Middleware::AccessLog provides a quick easy way to record Apache style logs, and one of the benefits of that is that you can specify custom fields that it can log using the format.
By specifying
"... %{Foo-bar}i .."
in the log format, you can populate the fields in each request by setting
$request->env->{FOO_BAR} = $foo;
Where $request is the Plack::Request object
Written by Aaron Trevena
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Perl
Authors

janosgyerik
25.24K

Jean-Remy Duboc
12.3K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#