Fp...@ao... wrote on 7/28/2004, 4:59 PM:
> log4perl.rootLogger=DEBUG, LogFile
> log4perl.rootLogger.Logger2=DEBUG, NTLog, A2
You might be rightfully surprised (and L4P does a bad job here not
warning you), but you're just defining a root logger this way -- that's
the reason why you only get one output message.
To define loggers other than the root logger, using categories, don't
forget the "logger" keyword:
log4perl.logger.top=DEBUG, LogFile
log4perl.logger.top.sub=DEBUG, NTLog, A2
Now, if you get a logger like
my $logger = get_logger("top.sub");
then
$logger->error("message");
will do the right thing.
One more comment:
if($logger->is_debug()) {
$logger->error("message");
}
can be reduced to
$logger->error("message");
because error() won't fire unless is_debug() (in fact is_error()) is true.
Let me know if this behaves the way you like it to now.
--
-- Mike
Mike Schilli
m...@pe...
|