From: Mike S. <m...@pe...> - 2004-07-07 16:57:55
|
Michael O'Connor wrote on 7/5/2004, 2:42 PM: > Wondering if it is possible to init_and_watch multiple configuration > files...? I've taken a look around at the modules, and it doesn't > appear to > be possible...just wanted confirmation. Hi Mike, you're correct, currently, Log::Log4perl supports exactly one configuration file. We've been thinking about adding multiple "Log4perl Repositories", but that's not going to be available in the short run -- it's quite hard to get it right, defining what is capable of overriding what and what happens to the overridden. > If i'm trying to debug one particular process, out of the 100 processes > running, I'd like to be able to modify the process-specific config > file, to > increase the debug level, and reap the benefits of init_and_watch. > Obviously I can do this with the central config file, but then all 100 > procs > would start logging debug info. There's probably a workaround, just let me explore a couple of possible options off the top of my head: * Are all of these processes identical or are they performing different tasks? If the latter, you could probably use a central config file and limit the exposure of the changes by assigning different categories to different processes. * Use one central config file, edit it to debug a single process, but filter messages at the appender level based on process ID/name, using a custom filter: log4perl.appender.MyAppender.Filter = sub { $$ == 1234 }; All other processes would pick up the change via init_and_watch, but their messages would be blocked by the filter. * Use the signal feature of init_and_watch(). In this case, processes won't periodically check the config file for modifications, but wait for a predefined signal to be sent to them. This way, you would have to trigger the update via an external program, sending the update signal to all processes which need to re-init. Any questions or feature requests, let us know. -- -- Mike Mike Schilli m...@pe... |