Dancer::Logger(3pm)
π Dancer::Logger β the manual, but make it slay π
Okay bestie, gather round, because we're talking about Dancer::Logger (3pm), the common interface for logging in Dancer. Yes that's the whole vibe. Logging. And it's iconic.
Version: 1.3522 β yes queen, we're on that version, no cap. β¨
π¦ DESCRIPTION π¦
So what even is this module? It's literally the wrapper that provides support for different logger engines. That's it. That's the whole job. It's giving middle-management, but in a cute way β it holds the engines together so you don't have to. π«Ά
πΈ USAGE πΈ
β¨ Default engine β¨
The setting logger defines which logger engine to use. That's the one that decides everything.
β οΈ Not me being dramatic but: if this setting is not set, logging will not be available in the application code. Like, at all. Zero. Nada. The vibe check fails. π
Dancer comes with the logger engines Dancer::Logger::File and Dancer::Logger::Console, but more are available on the CPAN. So if you want options, bestie, the CPAN has you covered. π
π Configuration π
The logger configuration variable tells Dancer which engine to use. You can change it in two ways, pick your fighter:
Option one β in your config.yml file:
# logging to console
logger: "console"
Option two β right in the application code:
# logging to file
set logger => 'file';
The log format can also be configured β go peek at "logger_format" in Dancer::Logger::Abstract for the details. Obsessed with a configurable format, honestly. π
π§ Auto-serializing π§
The loggers allow auto-serializing of all inputs. So like, you can do this:
debug( 'User credentials: ', \%creds );
And it Will provide you with an output in a single log message of the string and the reference dump. One message. Both things. Together. Slay. π₯
π AUTHORS π
This module has been written by Alexis Sukrieh. See the AUTHORS file that comes with this distribution for details. Shoutout to the author, fr fr. π
π LICENSE π
This module is free software and is released under the same terms as Perl itself. Free as in freedom, bestie. Go wild. π¦
π SEE ALSO π
- See Dancer for details about the complete framework. Like, the whole entire framework. π
- You can also search the CPAN for existing engines in the
Dancer::Loggernamespace: <http://search.cpan.org/search?query=Dancer%3A%3ALogger>
β AUTHOR β
Dancer Core Developers
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2010 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
πΈ That's the whole page, bestie. Go forth and log. πΈ
Sign-off tea: this page is from perl v5.40.1, dated 2026-05-05, and yes it's Dancer::Logger(3pm) β the one and only. Byeee πβ¨π
π¦ where this page comes from
- ubuntu stonking: libdancer-perl 1.3522-2 Β· 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