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 around
  • Plack::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