NAME
Log::Cabin - Partial implementation of Log::Log4perl with reduced disk IO.
SYNOPSIS
use Log::Cabin;
my $log_level = 'WARN';
my $logsimple = new Log::Cabin();
$logsimple->level( 4 );
$logsimple->set_file_output( 'some.file.log' );
# another option
# $logsimple->set_output(*STDERR);
my $logger = $logsimple->get_logger('some.category');
$logger->debug("this is a debug message");
$logger->info("here's an info message");
$logger->warn("now a warning message");
$logger->error("things are going down");
$logger->fatal("it's all gone pete tong");
#### the output some.file.log will look like this ####
some.category INFO Wed Apr 18 02:27:10 2007 colossus:21151 ./test.pl:main:Log::Cabin::Foundation::info:18 || here's an info message
some.category WARN Wed Apr 18 02:27:10 2007 colossus:21151 ./test.pl:main:Log::Cabin::Foundation::warn:19 || now a warning message
some.category ERROR Wed Apr 18 02:27:10 2007 colossus:21151 ./test.pl:main:Log::Cabin::Foundation::error:20 || things are going down
some.category FATAL Wed Apr 18 02:27:10 2007 colossus:21151 ./test.pl:main:Log::Cabin::Foundation::fatal:21 || it's all gone pete tong
######################################################
DESCRIPTION
Log::Cabin provides a selection of the features of Log::Log4perl but with a focus on reduced disk IO. Just calling 'use Log::Log4perl' results in hundreds of stat calls to the file system. If you have a shared file system with many nodes running perl scripts at once, this could result in a significant decrease in performance.
After implementing this module we were able to cut up to 70,000 stat/open calls per second on our NFS. Of course, this module doesn't currently support all the features of Log::Log4perl, but many of the most comment ones are implemented.
EXPORT
None by default.
SEE ALSO
The usage of this module is similar to Log::Log4perl.
AUTHOR
Joshua Orvis, <jorvis@users.sourceforge.net> and Sam Angiuoli, <angiuoli@users.sourceforge.net>
COPYRIGHT AND LICENSE
This module is available under the Artistic License
http://www.opensource.org/licenses/artistic-license.php
Copyright (C) 2006-2007 by Joshua Orvis and Sam Angiuoli