Plack:...:LogAny(3pm)
π Plack::Middleware::LogAny β the manual, but make it cute π
okay bestie, so this is the page for Plack::Middleware::LogAny (perl v5.38.2, dated 2024-08-03, in case the vibe check requires receipts β¨). It's a Plack middleware that hands your PSGI app's logging over to Log::Any, and honestly? It's giving main character energy. π
β¨ NAME β¨
Plack::Middleware::LogAny β use Log::Any to handle logging from your PSGI application. No cap, that's the whole thing. π
β¨ SYNOPSIS β¨
Okay so here's how you'd actually use it. First, in your app.psgi file:
# in app.psgi file
use Plack::Builder;
Then you've got your PSGI application, like the girlboss you are:
# PSGI application
my $app = sub { ... };
Now β the DSL interface, which is the slay way to do it:
# DSL interface
builder {
enable 'LogAny', category => 'plack', context => [ qw( X-Request-ID ) ];
$app;
}
Or if you're feeling more OO about it, there's an alternative interface too:
# alternative OO interface
Plack::Middleware::LogAny->wrap( $app, category => 'plack', context => [ qw( X-Request-ID ) ] );
Periodt. π
β¨ DESCRIPTION β¨
So LogAny is a Plack::Middleware component that lets you use Log::Any to handle the psgix.logger logging object. π¦
That object? It's a code reference, and it's described over in PSGI::Extensions. Iykyk. π
β¨ METHODS β¨
πΈ prepare_app()
This method initializes the logger using the category that you optionally set. Cute, right? β¨
πΈ call()
This method sets the logging object and the logging context. The logging context is localized. π
β¨ CONFIGURATION OPTIONS β¨
categoryβ theLog::Anycategory to send logs to. It defaults to'', which means it sends to the root logger. πcontextβ as of release0.002π β a list of HTTP header names that gets passed from the PSGI environment to theLog::Anylogging context. π
β¨ AUTHOR β¨
Sven Willenbuecher <sven.willenbuecher@kuehne-nagel.com> π«Ά
β¨ COPYRIGHT AND LICENSE β¨
This software is copyright (c) 2012 by Michael Alan Dorman. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πΈ
β¨ SEE ALSO β¨
Log::Anyπ
And that's the whole page, bestie β perl v5.38.2, dated 2024-08-03, brought to you by the good folks of the User Contributed Perl Documentation. Slay, stay logged, and remember to localize your context. π β¨π
π¦ where this page comes from
- debian trixie: libplack-middleware-logany-perl 0.002.001-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libplack-middleware-logany-perl 0.002.001-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libplack-middleware-logany-perl 0.002.001-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms