I use SimpleLog for logging. Here my configuration for my class LogonAction. You can set individual log levels for each class.
commons-logging.properties file: org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
simplelog.properties file: org.apache.commons.logging.simplelog.showdatetime=true org.apache.commons.logging.simplelog.defaultlog=info org.apache.commons.logging.simplelog.log.LogonAction=warn ...
LogonAction.java file: ... private Log log = LogFactory.getLog("LogonAction"); ... log.warn("---> Error bla bla bla"); ...
Make sure the two files 'commons-logging.properties' and 'simplelog.properties' are in the directory /WEB-INF/classes (not in a subdirectory)
See also 'Package Description' and the 'Log' class in the documentation: http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/package-summary.html#package_description http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/Log.html
have fun Koni
Duan Qiang wrote:
Hi,
I want to have fine-grained configure of logging in my struts application, for example, for class A, it allows info level logging, for class B, it allows trace level logging. I surfed the net and found some entries in the commons-logging properties file, for example
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog org.apache.commons.logging.simplelog.log.LogonAction=info
I wonder are there any other entries so that I can control the logging level for different classes? ( I created the log each class, for example, log = LogFactory.getLog(A.class);
Where is the doc for all the entries that user can input in the file? I read the source codes of the logging package but did not find the answer and I guess I must have missed sth.
Thanks for your time.
Regards,
Duan Qiang
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- visit us at: http://www.rothweb.ch http://www.rothconsulting.com Jump and the earth will rise to meet you!
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]