NAME

Kelp::Module::Logger - Logger for Kelp applications

SYNOPSIS

 # conf/config.pl
 {
     modules => ['Logger'],
     modules_init => {
         Logger => {
             outputs => [
                 [ 'Screen',  min_level => 'debug', newline => 1 ],
             ]
         },
     },
 }

# lib/MyApp.pm
sub run {
     my $self = shift;
     my $app = $self->SUPER::run(@_);
     ...;
     $app->info('Kelp is ready to rock!');
     return $app;
}

DESCRIPTION

This module provides an log interface for Kelp web application. It uses Log::Dispatch as underlying logging module.

CONFIGURATION

All module's configuration is passed to Log::Dispatch, so consult its docs for details. In addition, following keys can be configured which change how the module behaves:

date_format

A string in strftime format which will be used to generate the date.

By default, value '%Y-%m-%d %T' is used.

log_format

A string in sprintf format which will be used to generate the log. Three string values will be used in this string, in order: date, log level and the message itself.

By default, value '%s - %s - %s' is used.

REGISTERED METHODS

debug

info

error

logger

$app->logger(info => 'message') is equivalent to $app->info('message').

SEE ALSO

Kelp::Module::Logger::Simple - always dumps to standard output