db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Roycroft" <jame...@telus.net>
Subject Torque.properties and Logging with Torque 3.1
Date Sat, 10 Apr 2004 19:18:43 GMT
In the 3.1 distribution of Torque (runtime), the torque.properties file
includes entries for logging with Log4J. I have never been able to get these
to work. I eventually found that Log4J is not reading the file at all. It
looks for a log4j.properties file in the classpath to use.

Torque itself has no problem reading the file, and parses the database
entries I have in there without fail. If I use Torque 3.0.2 with the same
file, the logging works.

Here is one of the logging functions I set up to log all Torque messages:

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = e:/webcrmtorque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p
%c - %m%n
log4j.appender.org.apache.torque.append = false

This whole setup is running under Tomcat 4.1 with a MySQL 4 backend. I would
like to know if this behavior in Torque 3.1 is by design, or if I have
something set up incorrectly in my environment.

Also, thanks to Rob Guest for his post on "Tips on fixing broken logging
configurations" which contained some useful information on the same lines.
Two notes on that:
- The java.class.path property is not really useful within Tomcat, as it
resolves to the bootstrap.jar used for launching Tomcat. I believe Tomcat
does not use the classpath at all, it creates its own. So the important
thing is to include log4j.properties in the classpath available to your web
application (WEB-INF\classes will work).
- The LogFactory class is part of the org.apache.commons.logging package
which you need to import to use the code snippet for checking the default
logger you have.

If I have left something out of my setup that you want to check on, the
source files and jars for this project are available in the suggested Tomcat
Web App form at http://www.codesilver.ca/cgi-bin/viewcvs.cgi/webcrm/

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message