[TransWarp] Multiple loggers

Phillip J. Eby pje at telecommunity.com
Tue Aug 19 19:02:27 EDT 2003


At 03:09 PM 8/19/03 -0700, John Landahl wrote:
>Is it possible to have multiple loggers for a given peak.logs entry, or even
>for peak.logs.*?  I'm trying to setup remote logging in addition to logging
>to stderr, so at the point in my application when the remote connection is
>made I'd like to be able to add a subclass of AbstractLogger to the already
>setup LogStream handler.  Is this at all possible, or can there only be one
>logger per property set?

There Can Be Only One.  However, that "One" could forward to multiple 
loggers.  We don't currently have such an animal, but presumably one could 
write a simple MultiLogger class that just forwarded all ILogger methods to 
each of its contained loggers.  Then you'd map the property to a 
MultiLogger, supplied with a list of all the loggers needed.

Ideally, the multilogger itself would have a level that it would check 
before issuing the calls, so as to minimize the total number of calls 
taking place.




More information about the PEAK mailing list