Dancer2::Logger::Log4perl - Dancer2 logger interface for Log4perl.
In your config.yml:
In your log4perl.conf:
log4perl.rootLogger = DEBUG, LOG1
log4perl.appender.LOG1 = Log::Log4perl::Appender::File
log4perl.appender.LOG1.filename = /var/log/mylog.log
log4perl.appender.LOG1.mode = append
log4perl.appender.LOG1.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.LOG1.layout.ConversionPattern = %d %p %m %n
This class is an interface between Dancer2's logging engine abstraction layer and the Log::Log4perl library. In order to use it, you have to set the logger engine to log4perl.
Dancer2's core level messages are passed to Log4perl as level trace but will not be passed unless Dancer2's log config is core.
log should be set a lower priority than the lowest priority as set in your Log4perl configuration. If it isn't, the log messages will not be passed to Log4perl.
If you don't specify config_file then Log4perl will easy init with the appropriate log level, as specified by Dancer2.
You can specify the log4perl configuration file using the config_file option:
You can optionally specify the watch interval, either in seconds or as 'HUP':
This was originally developed by Ryan Larscheidt and Jon Miner at the University of Wisconsin. The initial version of this was built upon their final version. I cannot thank them enough for their work on this - it not only solved my needs at $work, but also plugs a hole in our ecosystem.
Jason A. Crome <email@example.com>
This software is copyright (c) 2018 by Jason A. Crome.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dancer2::Logger::Log4perl, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.