NAME
    Dancer::Logger::Log4perl - Dancer adapter for Log::Log4perl

VERSION
    version 0.7.0_03

SYNOPSIS
       # In your config.yml
       logger: log4perl
       log4perl:
          config_file: log4perl.conf

       # 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

DESCRIPTION
    This class is an interface between Dancer's logging engine abstraction
    layer and the Log::Log4perl library. In order to use it, you have to set
    the "logger" engine to "log4perl".

    You can use either Log::Log4perl or Log::Log4perl::Tiny. If you want to
    use the latter, just specify the "tiny" option in the specific
    configuration.

    You can decide to let the module perform the initialisation of the
    logging system, or you can do it by yourself. In the latter case, you
    can pass the "no_init" parameter, which instructs the module not to
    perform the initialisation.

    After initialisation, you can decide to use Dancer's functions or the
    ones provided by either Log::Log4perl or Log::Log4perl::Tiny, e.g. the
    stealth loggers in case of a simplified interface.

CONFIGURATION
    The configuration capabilities vary depending on the underlying library
    you have, even though the following configurations are common:

    no_init
        skip the initialisation phase of the logging module, assuming that
        it is performed elsewhere.

    tiny
        allows you to decide whether Log::Log4perl (when set to a false
        value) or Log::Log4perl::Tiny (when set to a true value) should be
        used.

  Log::Log4perl
    If you're using standard Log::Log4perl, then you have two alternatives
    to pass a configuration:

    config_file
        via a configuration file, using the "config_file" option:

           logger: log4perl
           log4perl:
              config_file: log4perl.conf

    config
        via a straight configuration text, using the "config" option:

           logger: log4perl
           log4perl:
              config: |
                 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

  Log::Log4perl::Tiny
    If all you have is Log::Log4perl::Tiny, you can set some parameters:

    level
        the log "level"

           logger: log4perl
           log4perl:
              tiny: 1
              level: INFO

    format
        the log "format" (aliased to "layout" as well)

           logger: log4perl
           log4perl:
              tiny: 1
              format: [%p] %m%n

AUTHOR
    Flavio Poletti <polettix@cpan.org>

COPYRIGHT AND LICENSE
    Copyright (C) 2011 by Flavio Poletti polettix@cpan.org.

    This module is free software. You can redistribute it and/or modify it
    under the terms of the Artistic License 2.0.

    This program is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of
    merchantability or fitness for a particular purpose.

