db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter S. Hamlen" <pham...@mail.com>
Subject Re: Torque Logging...
Date Fri, 14 Feb 2003 19:20:00 GMT
(Disclaimer:  I'm using Torque 3.0b2 so this may be slightly out of
date.)

Sriram,

Probably the best way to handle this is to create a log4j.properties
file somewhere in your classpath.  By the magic of
apache.commons.logging, it will find the log4j file and then use it for
logging.

I believe they took out the ability to place log4j configuration files
in the Torque.properties file.  So you have to place them in your
log4j.properties file.

My sample log4j.properties file looks like this:
# log4j init properties  

# By default, we only want WARNING errors or above
# for most classes.
#
# look for stdout and redOut appenders to understand
# what they're doing.

# category definitions
# we send ALL messages from torque, struts and redwood classes to 
# stdout and redOut 

log4j.category.org.apache.torque=debug,  redOut
log4j.category.org.apache.struts=info, redOut
log4j.category.org.tfa.redwood=info,  redOut


# called "redwood.log" - this file gets created
# in the local directory.

log4j.appender.redOut=org.apache.log4j.FileAppender
log4j.appender.redOut.File=redwood.log
log4j.appender.redOut.layout=org.apache.log4j.PatternLayout
log4j.appender.redOut.layout.ConversionPattern=[%p %c] - %m%n



-Peter

On Fri, 2003-02-14 at 10:00, Puvvada, Sriram wrote:
> How to set logging in Torque? 
> I need to log each sql statement executed by torque. I have set the
> following torque properties 
> 
> log4j.category.org.apache.torque 		- 		ALL
> log4j.appender.org.apache.torque 		-
> org.apache.log4j.FileAppender
> log4j.appender.org.apache.torque.file		-
> d:\torque.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
> 
> But still any of sql statements is logging. Do i miss any property setting?
> 
> Regards,
> Sriram.
> 
> ---------------------------------------------------------------------
> 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