commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Toohey <>
Subject commons logging configuration
Date Mon, 20 Jan 2003 17:46:00 GMT
I am trying to use commons logging with SimpleLog, and can get it to work, 
but what I've found does not correspond with the commons logging javadoc 
documentation when it comes to the file.

Per the documentation, the default LogFactory implementation chooses the 
underlying log implementation in the following order:
1. look for system property org.apache.common.logging.Log
2. look for configuration attribute of the factory named 
3. use Log4J if in the app class path
4. use JDK 1.4 if in app class path
5. use no output

I do not have Log4J in the class path and I am using JDK 1.4. My app is a 
webapp running in Tomcat.

To choose SimpleLog, I put a file in the 
WEB-INF/classes directory with the following:

However, even though SimpleLog is being specified as a configuration 
attribute of the default LogFactory implementaion, commons logging chooses 
Jdk14Logger. The javadocs state that the factory config attribute should be 
considered before Jdk14Logger. 

By the way, if I define SimpleLog as a system property on starting Catalina, 
then commons logging correctly chooses SimpleLog:
So I can get SimpleLog, but am wondering why I can't choose it using

So in a nutshell, either the javadocs are wrong (and commons logging chooses 
Jdk14Logger before it looks at the factory configuration attributes in, or, commons logging is ignoring my file for some reason, or I'm doing something wrong.

By the way, when I choose SimpleLog via the system property method, the file is used correctly, and that is also in 
WEB-INF/classes, so I don't think there is a problem with not being in the class path. 

Any insight ?



View raw message