Torsten Curdt wrote:
Maybe just throw away (Abstract)LogEnabled and do constructor injection instead. Or even relegate Logging to an ordinary service, which is looked up like any other component.
As much as I like IoC I think logging is one of the reasons for overcomponentization. ...just because you need a logger instance.
Why? Nothing prevents you from writing: Blah blah = new Blah(); blah.setLogger(getLogger());
Passing it to the POM does not make it much nicer. In fact it's sometimes hard to draw the line. Component ...not a component.
Uh? "POM"?
Have logging as an explicit service does definitely not feel right to me. Logging should be much more low-level!
A big +1. *That* would lead to over-componentization !
I am not sure but to me IoC seems to hurt more than it helps for logging. May I play devils advocate:
For how many projects would this *really* be a security issue?
If someone can log to your logger you probably have bigger problems!
...and btw: if you need to you *can* get to any logging channel even with logkit IIRC.
Yup: Hierarchy.getDefaultHierarchy().getLogger("any.category");Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
