|
From: Kevin G. <ke...@go...> - 2004-09-16 15:31:44
|
Mike Schilli wrote:
> Aldrich, Timothy wrote on 9/15/2004, 10:11 AM:
>
> it's something people who are
> not familiar with the categories concept would jump right into for tasks
> that could be solved much more elegantly with categories. With your
> requirements, though, it makes sense. Another option would be a custom
> filter grepping for certain keywords (like "[status]...") in the log
> message and forwarding matching ones to the appropriate appender.
Here's a way to approach the problem using a separate log category.
It's probably a matter of taste when choosing between this or creating a
new log level. Although this way does make pretty clear in the program
code that the purpose and destination of the two log messages is different.
$logger = Log::Log4perl::init('some.category');
$statuslogger = Log::Log4perl::init('status');
$logger->debug("here is a regular debug message");
$status_logger->info("program ended at @{[scalar localtime]}");
--
Happy Trails . . .
Kevin M. Goess
(and Anne and Frank)
904 Carmel Ave.
Albany, CA 94706
(510) 525-5217
|