On 04-01-2005 23:51, "Jorge CAMPOS" <[EMAIL PROTECTED]> wrote: > Hi!
Hi Jorge! > I've modified the org.apache.avalon.framework.logger.Logger interface to add > a changeLevel method... I've also changed the implementations to support > this method... In this way the log level can be reset at runtime. > > What do you think about the approach? Hmm. To be honest I think its the wrong way to solve whatever problem it is you're trying to solve (which I'm kinda guessing about...). The key bit is that adding a changeLevel() method is saying "look, component, go right ahead and decide for yourself how much to log", which kind-of violates the inversion of control principle. The container decides how much of a component is log messages make it elsewhere, not the component. > I've speculated changing LoggerManager > instead, but since you can get a specific logger from the LoggerManager the > right place seemed to be Logger. Changing the manager sounds more sensible. I can imagine such a change might have to be a bit more extensive (I don't know the excalibur-logger code all that well), but it'll probably be worth it. > If it is OK, is it possible to post it somewhere for consideration towards > its inclusion in the framework? Well regardless of whether such a change is a good idea actually pushing it into the framework might be problematic. When we change the interface, third party implementations (for example there's a few that wrap Commons-Logging) would all need to be modified to support it, and my guess that isn't so trivial to manage. (...) Usually when I have to change some bit of configuration at runtime and that change isn't transparent to a component instance I tend to just dispose of the instance and replace it with a new one. Turns out to be a lot easier than implementing reconfiguration in 80% of the cases. You might want to consider that :-D Hope that helps! Cheers, Leo --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
