View on
MetaCPAN
Jesper Dalberg > Log-Log4perl-Appender-Spread > Log::Log4perl::Appender::Spread

Download:
Log-Log4perl-Appender-Spread-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Log::Log4perl::Appender::Spread - Log to a spread group

SYNOPSIS ^

    use Log::Log4perl::Appender::Spread;

    my $app = Log::Log4perl::Appender::Spread->new(
      SpreadGroup => 'SOMELOGGRP',
      SpreadName => '4803@somewhere';
      SpreadPrivateName => 'uniquelogger';
    );

    $app->log(message => "Log me\n", level => INFO);

DESCRIPTION ^

This is a simple appender for writing to a spread group.

METHODS ^

new

The new() method takes a few options to tell the module how to behave. They are:

SpreadGroup. This is the spread group that log messages will be sent to.

SpreadName. Used to tell the module where spread is running so that it can connect.

SpreadPrivateName. Used while connecting to spread. The name should be uniqe on the spread system.

SpreadMailbox. Used when the module wanting to invoke Log4perl for logging is allready connected to spread with its own mailbox. When this is set, Log::Log4perl::Appender::Spread will NOT attempt to connect to spread, and SpreadName and SpreadPravateName will be ignored.

log

The log() method takes the level and message parameters. If a newline character should terminate the message, it has to be added explicitely.

Upon destruction of the object, the appender will leave the spread group and disconnect from spread.

If you want to switch over to a different spread group at runtime, use the reconnect({same options as new} method which will first close the old connection and then open a one with the new spread parameters.

Design and implementation of this module has been greatly inspired by Mike Schillis Log::Log4perl::Appenders::File appender.

AUTHOR ^

Jesper Dalberg <jesper@jdn.dk>, 2004

syntax highlighting: