Log wars? :-PPP Let's say: "logging, can't we finally solve it?" ;-)
Paul Hammant wrote, On 09/02/2003 11.50:
Ok, let me be more clear on my position: reusable beans should not depend on any logging stuff. This point was a possible compromise, but I don't like it much. Would you care explaining it a bit more in detail and proposing it ti Jakarta Commons?Nicola,I understand what you mean. We already have facades, why put in a facade to a facade that does the same thing our facades do?I'd disagree. I am fond of the no-logging design for reusable beans (use a monitor concept instead).
In fact, why not deprecate our facades and use the commons logging ones?
Talking about the "real" solution, it would seem that it would involve these steps:
1) Utility packages like jakarta commons ones use commons-logging.
It's the easiest and most sensible solution for fine grained stuff.
You mean using CL actually in the code? Hmmm, why simply not use our logger interface still and CL as a facade's facade? In your "correction", users can use different Loggers in the code, correct? Hmmm...2) Avalon Framework uses commons-logging as the facade for logging toCorrection:- "Avalon Framework facilitates CommonsLogging at instance level" (CommonsLogEnabled, AbstractCommonsLogEnabled).
different implementations. This means that coarse-grained components
keep using AF4-compatible IOC.
I did much experimentation some months ago. It is not so easy.3) Every Avalon container registers it's own LogFactory as a top-level LogFactory, so that it intercepts *all* logging calls and can deal with them in a centralized way, somewhat inverting the control.
Why?
If weThey pointed out that CL can easily be used with IOC. Just don't use the static accessor and use a setLogger method.
can eradicate the static nature to Commons-Logging (and most importantly its usages in Commons) we have a chance of making it work. C-L was not designed at all with IoC in mind...
The fact is that it's really not feasable to pass loggers in an IOC way everywhere in bean code. I tried it with POI, and it was a mess.
The fact is not that static accessors solve a need, a *real* need, that is access to a logger for fine-grained components with big hierarchies.
If we solve the need in another way, static accessors may not be needed.
--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
