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 πŸ”


⭐ AUTHOR ⭐

Dancer Core Developers


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