DESCRIPTION

Log::Any is a logging abstraction that allows CPAN modules to log without knowing about which logging framework is in use. It supports standard logging methods ($log->debug, $log->is_debug) along with sprintf variants ($log->debugf).

Log4perl is a powerful logging package that provides just about any logging-related feature you'd want. One of its only drawbacks is its somewhat cumbersome configuration. So, we provide a way to configure Log4perl simply through Poet configuration if you just want common features.

Note: Log4perl is not a strict dependency for Poet. Log messages will simply not get logged until you install it or until you modify logging for your app.

CONFIGURATION

The configurations below can go in any Poet conf file, e.g. local.cfg or global/log.cfg.

Here's a simple configuration that caches everything to logs/poet.log at info level. This is also the default if no configuration is present.

Using log handle

MODIFIABLE METHODS

These methods are not intended to be called externally, but may be useful to override or modify with method modifiers in subclasses. Their APIs will be kept as stable as possible.

initialize_logging

Called once when the Poet environment is initialized. By default, initializes log4perl with the results of "generate_log4perl_config" and then calls Log::Any::Adapter->set('Log4perl'). You can modify this to initialize log4perl in your own way, or use a different Log::Any adapter, or use a completely different logging system.

generate_log4perl_config

Returns a log4perl config string based on Poet configuration. You can modify this to construct and return your own config.