From: Aldrich, T. <tim...@cs...> - 2004-09-15 17:11:38
|
Thank you for the reply. I erroneously called them categories , which means source classes. what I should have called it was a log level. My program is currently using levels DEBUG through FATAL so going back through and moving meaningful logging messages out of INFO would require a bit of work. I see in the docs that it's deprecated ( though really easy :) to create a new level , which seems to be a perfect fit. This is what I was originally asking when I mistakenly called them categories instead of levels. adding a level called STATUS would be a simple way to sprinkle in $logger->status() messages designed for this new log without refactoring my whole logging methodology. _Why_ is this deprecated , am I missing a draw-back to this approach ? R/S Timothy Aldrich --------------- -- ============================================================================== This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. ============================================================================== |
From: Aldrich, T. <tim...@cs...> - 2004-09-16 20:38:45
|
> 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]}"); > schweet ! Thank you so much ! now I don't feel naughty for using depricated code. R/S Timothy Aldrich --------------- -- ============================================================================== This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. ============================================================================== |
From: Mike S. <m...@pe...> - 2004-09-15 18:11:04
|
Aldrich, Timothy wrote on 9/15/2004, 10:11 AM: > adding a level called STATUS would be a simple way to sprinkle in > $logger->status() messages designed for this new log without refactoring > my whole logging methodology. > > _Why_ is this deprecated , am I missing a draw-back to this approach ? > I guess the main reason is that it's an additional hurdle for Log4X users to find non-standard log levels. And 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. -- -- Mike Mike Schilli m...@pe... |
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 |