Log::Log4perl::Appender::Spread - Log to a spread group
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);
This is a simple appender for writing to a spread group.
The new() method takes a few options to tell the module how to behave. They are:
new()
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.
The log() method takes the level and message parameters. If a newline character should terminate the message, it has to be added explicitely.
log()
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.
reconnect({same options as new}
Design and implementation of this module has been greatly inspired by Mike Schillis Log::Log4perl::Appenders::File appender.
Log::Log4perl::Appenders::File
Jesper Dalberg <jesper@jdn.dk>, 2004
To install Log::Log4perl::Appender::Spread, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Log4perl::Appender::Spread
CPAN shell
perl -MCPAN -e shell install Log::Log4perl::Appender::Spread
For more information on module installation, please visit the detailed CPAN module installation guide.