From: "Jeremias Maerki" <[EMAIL PROTECTED]> > > In a server environment especially, good role hierarchy and containment is > > paramount, and Avalon helps to enforce and use it. > > > > One thing though: Logging is a bit different than other things... it's not > > really a component, but an aspect. > > This means that we would need another programming language to use it > > correctly from a framework POV... > > > > In practice, I have seen that the best thing is making the big blocks get a > > Logger from the parent, and have the smaller classes get it from a static > > method that permits the usage of a "key", that in the case of important > > classes can be set from the outside. > >That surprises me a little. I tend to extend from AbstractLogEnabled > even for small classes if I need a Logger. But you're probably right > that this reduces memory usage especially if you have a lot of small > objects like we have in FOP.
The fact that you are surprised is a good sign, because it means that you come from a purist view of IoC, which is always the best place to start from. I had your same vision till I tried implementing logging in Jakarta POI... a nightmare! Hundreds of classes, that were used as the object model, and it soon became not only slow but impractical. If I forgot to set a logger for a child class, the whole thing would crash with a NPE. I've come to the conclusion that smaller classes that are not really components are better of with a static system, since they use logging only during debugging. In this case JDK1.4 style logging is the best, since it can be removed compile-time. This becomes not correct with bigger Components, where Logging is part of the usage too, like server Components that log accesses for example. In this case Avalon Logging framework has indeed no true rivals :-) -- Nicola Ken Barozzi [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) --------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]