15 Sep 2022 07:46:41 UTC
- Distribution: Log-Report
- Module version: 1.34
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (372 / 6 / 2)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Activity24 month
- Download (99.09KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Dancer2::Logger::LogReport - reroute Dancer2 logs into Log::Report
Dancer2::Logger::LogReport is a Moo::Object
# This module is loaded when configured. It does not provide # end-user functions or methods. # See DETAILS
[The Dancer2 plugin was contributed by Andrew Beverley]
This logger allows the use of the many logging backends available in Log::Report. It will process all of the Dancer2 log messages, and also allow any other module to use the same logging facilities. The same log messages can be sent to multiple destinations at the same time via flexible dispatchers.
If using this logger, you may also want to use Dancer2::Plugin::LogReport
Many log back-ends, like syslog, have more levels of system messages. Modules who explicitly load this module can use the missing
alertlog levels. The
tracename is provided as well: when you are debugging, you add a 'trace' to your program... it's just a better name than 'debug'. You will need to load Log::Report in order to use the additional levels; if doing so directly within a Dancer2 application (not a sub-module), then you will either need to load Log::Report with
syntax, 'LONG'or use Dancer2::Plugin::LogReport to prevent namespace clashes.
If using this module on its own (such as a drop-in replacement for Dancer2::Logger::Syslog), then the logging format is configured as with any other Dancer logger. If using this module with Dancer2::Plugin::LogReport, then log_format is ignored and messages are not formatted, in order to keep the message format consistent regardless of where the message was generated (be it another module using Log::Report, the plugin, or Dancer itself). In this case, the log format should be configured using the applicable dispatcher (such as Log::Report::Dispatcher::Syslog::new(format)).
If also using with the Log::Report logging functions, then you probably want to set a very simple
logger_format, because the dispatchers do already add some of the fields that the default
simpleformat adds. For instance, to get the filename/line-number in messages depends on the dispatcher 'mode' (f.i. 'DEBUG').
You also want to set the Dancer2 log level to
debug, because level filtering is controlled per dispatcher (as well).
See "DETAILS" in Dancer2::Plugin::LogReport for examples.
This module is part of Log-Report distribution version 1.34, built on September 15, 2022. Website: http://perl.overmeer.net/CPAN/
Copyrights 2007-2022 by [Mark Overmeer <firstname.lastname@example.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/