From: Michael O'C. <mi...@ch...> - 2004-07-06 22:04:50
|
Hi, 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. If it isn't possible, do you think this would be a useful feature? What I'd like: I have 600 processes running throughout the day. At any one time there could be, say, 100 running at the same time. I want to be able to have one central configuration file that is init_and_watch'd by all processes by default. In addition, I'd like to have a process-specific config file (also init_and_watched) that could define the same config setup, overriding the central config, or new configuration allowing me to log to a new file/whatever. What I'm trying to acheive: 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. Is this clear? Any feed back would be much appreciated! Thanks Mike O'Connor mi...@ch... |
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... |
From: Michael O'C. <mi...@ch...> - 2004-07-07 21:31:47
|
Hi Mike S, > * 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. Hmmm, the procs are a mixture, some of the same, some different...I'd considered this, but it would prove too cumbersome. > * 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. These two options sound like the best approach, until support for multiple config files can be provided. Thanks for your help, and prompt response!!! Do you have a list of concerns regarding multiple config files? I may be able to spend some time assisting in providing a solution. Thanks! Mike. |
From: Mike S. <m...@pe...> - 2004-07-08 07:08:13
|
Michael O'Connor wrote on 7/6/2004, 2:09 PM: > Do you have a list of concerns regarding multiple config files? I may be > able to spend some time assisting in providing a solution. My major concern is that it will be hard to predict Log4perl's behaviour if N configurations are applied subsequently, overwriting each other's settings. If we could work out a simple and sound strategy, that'd be a first step. -- -- Mike Mike Schilli m...@pe... |