Plack::...ispatch(3)
π Plack::Middleware::LogDispatch β the manual page, bestie edition π
okay so you found the page for Plack::Middleware::LogDispatch (that's section 3 of the manual, filed under User Contributed Perl Documentation, iykyk) and bestie, you're in the right place. this is the little middleware that lets you plug a whole Log::Dispatch logging setup into your Plack app and have it just vibe. let's go π«Ά
β¨ NAME β¨
Plack::Middleware::LogDispatch β it uses Log::Dispatch to configure your logger. that's the whole job. iconic behavior honestly.
π¦ SYNOPSIS π¦
here's the tea, in code, because obviously:
use Log::Dispatch;
my $logger = Log::Dispatch->new;
$logger->add( Log::Dispatch::File->new(...) );
$logger->add( Log::Dispatch::DesktopNotification->new(...) );
builder {
enable "LogDispatch", logger => $logger;
$app;
}
and if you're an Log::Dispatch::Config girlie, you can do this instead:
# use with Log::Dispatch::Config
use Log::Dispatch::Config;
Log::Dispatch::Config->configure('/path/to/log.conf');
builder {
enable "LogDispatch", logger => Log::Dispatch::Config->instance;
...
}
like. it's giving plug and play. notice how in the second one you don't even hand it a logger you built yourself β you just pass Log::Dispatch::Config->instance and let the config file do its little thing. main character energy fr fr π
π DESCRIPTION π
so here's what's actually happening. LogDispatch is a Plack::Middleware component β meaning it slots into your middleware stack like it was always meant to be there β and what it does is let you use Log::Dispatch to configure the logging object, which is psgix.logger.
that's it. that's the whole plot. you bring the Log::Dispatch object, it takes over psgix.logger, and your app logs through it. obsessed. π
π CONFIGURATION π
πΈ logger
loggerβ the Log::Dispatch object where your logs get sent. this one is Required, no cap. you can't skip it. there is no default. if you don't pass it, nothing is cooking. π₯
π AUTHOR π
Tatsuhiko Miyagawa β the legend themselves. bow down. π«Ά
π SEE ALSO π
Log::Dispatchβ the logging machinery this whole thing is built aroundPlack::Middleware::Log4perlβ your other logging middleware option, if Log4perl is more your vibe
and that's the page bestie!! π this was served up from perl v5.42.3, dated 2026-10-18, in the Plack::...ispatch(3) corner of the manual β so go forth, pass your logger, and let your logs slay. periodt. π
β¨
π¦ where this page comes from
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms