On May 13, 2009, at 5:19 PM, Vincent Massol wrote:
Hi,
I wanted to see if we could move our LogEnabled lifecycle phase to a
Logging component. I think it's not going to work since this means
injecting a LoggingFactory/LoggingManager component and you need to
call getLogger(this.getClass()) to get access to the Logger which is
awkward.
What I propose:
1) Use SLF4J (drop the slf4j-log4j jar in our WEB-INF/lib so that
SLF4J uses log4j by default)
2) Drop the JCL/JUL/LOG4j SLF4J legacy jars in our WEB-INF/lib too
and exclude the JCL/JUL/LOG4J jars from our poms so that all third
party logs go to our logging system
3) Non component code should use a SLF4J's LoggerFactory directly
and have a setLogger(Logger) method so that they can be unit tested
easily.
-Vincent
4a) Keep LogEnabled and AbstractLogEnabled for our components
or
4b) Automatically inject a Logger and a ComponentManager when there
are fields with these types in a component class.
I like 4b) for its simplicity but I'm worried by the "magical"
aspect of it.
WDYT?
Thanks
-Vincent