From: Zoran V. <zv...@ar...> - 2006-06-25 13:50:33
|
Am 25.06.2006 um 14:41 schrieb Stephen Deasey: > If you add facility, you could: > > ns_logctl register $facility $priority joblog ?arg ...? > > The filtering would be done by the server, rather than the callback. > You're focusing on sinks here, but you need a way to distinguish what > goes where, and facility levels seem like such a standard thing. It > would enable you to turn on verbose logging for just one area of code, > which would reduce log spam. > > Take a look at log4j by the apache project. This is very popular and > seems to have inspired a lot of imitators such as log4py, log4c etc. > Maybe log4c has a better API than the old Ns_ModLog stuff. In this case, the ns_log call will also have to change as in: ns_log facility severity arg ?arg...? or? If this is true, then I would not like to do that, as one of my main targets is: keep the changes to the existing code as minimal as possible. For example, I can wrap one of our internal procedures which calls 100's of other, which in turn already use ns_log (and Ns_Log()) to fill-in the log file: ns_logctl register backup_log [getjobid] backup [getjobid] ns_logctl unregister backup_log This way all ns_log's called between those two ns_logctl will emit log entries not only to the global server logfile but also where backup_log procedure will send them. I need not modify ANY other places in the code. Does this compute? Or did I misunderstand your idea? Cheers, Zoran |