Brian Duggan > Clustericious-Log-0.10 > Clustericious::Log

Download:
Clustericious-Log-0.10.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.10   Source   Latest Release: Clustericious-Log-0.15

NAME ^

Clustericious::Log - A Log::Log4perl wrapper for use with Clustericious.

SYNOPSIS ^

    use Clustericious::Log -init_logging => "appname";

    use Clustericious::Log;
    INFO "Hi there!";

DESCRIPTION ^

This is a simple wrapper around Log::Log4perl for use with Clustericious. It handles initialization and exporting of convenient logging functions, and a default set of logging patterns. It also makes the name of the application available for logging patterns (see the example).

EXAMPLE ^

Here is a sample $HOME/etc/log4perl.conf :

    log4perl.rootLogger=TRACE, LOGFILE
    log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
    log4perl.appender.LOGFILE.filename=/tmp/some.log
    log4perl.appender.LOGFILE.mode=append
    log4perl.appender.LOGFILE.layout=PatternLayout
    log4perl.appender.LOGFILE.layout.ConversionPattern=[%d{HH:mm:ss}] [%8.8Z] %C (%F{1}+%L) %5p: %m%n
    # Note 'Z' is the name of the Clustericious application.

METHODS ^

init_logging

Start logging. Looks for log4perl.conf or $app.log4perl.conf in $HOME/etc, /util/etc and /etc.

tail

Returns a string with the last $n lines of the logfile.

If multiple log files are defined, it only uses the first one alphabetically.

ENVIRONMENT ^

The following variables affect logging :

    LOG_LEVEL
    LOG_FILE
    MOJO_APP
    HARNESS_ACTIVE
    CLUSTERICIOUS_TEST_CONF_DIR

NOTES ^

This is a beta release, the API may change without notice.

SEE ALSO ^

Log::Log4perl, Clustericious

syntax highlighting: