in reply to Mastering Log::Log4perl

Book must suck horribly :)
use strict; use warnings; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init( { file => ">> error_log", level => $ERROR, }, { file => "STDERR", level => $DEBUG, } ); ERROR( "I've got something to say!" ); DEBUG( "Hey! What's going on in there?" ); print "\$DEBUG = $DEBUG\n\$ERROR = $ERROR\n"; print " THE CURRENT LEVEL IS ", Log::Log4perl->get_logger->level,"\n"; __END__ 2009/10/25 13:23:40 I've got something to say! 2009/10/25 13:23:40 Hey! What's going on in there? $DEBUG = 10000 $ERROR = 40000 THE CURRENT LEVEL IS 10000

Replies are listed 'Best First'.
Re^2: Mastering Log::Log4perl
by Anonymous Monk on Oct 26, 2009 at 13:31 UTC
    I think log4perl-easy3.pl is an example of what not to do (anti-example?)