db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject AW: Don't get Torque's loggin to work
Date Tue, 16 Nov 2004 14:06:19 GMT




Hi Daniel,

I have looked in my logfiles and I have also only seen the selects. My
guess is that the select sql is created natively by torque and are logged,
whereas the updates are done via the village library, which does not do any
logging.
If you want to know the sql statements, I remember that some people use
p6spy to log their sql statements (never done it myself). See
http://wiki.apache.org/db-torque/FrequentlyAskedQuestions item 5 for more
info.

   Thomas

"Vitzethum, Daniel" <Daniel.Vitzethum@gigatronik.com> schrieb am 16.11.2004
14:27:16:

> Hi Thomas,
>
> here are my results - I took the time anyway ;-)
>
> It seems to me that the main problem was a version
> difference between Torque 3.1's log4j configuration
> and the version I use, which is log4j 1.2.8.
>
> (From http://logging.apache.org/log4j/docs/manual.html:
> "However, since log4j version 1.2, Logger class has replaced the
> Category class.")
>
>
> One questions still remains: I can only see SELECTs in log output,
> no e.g. INSERTs. There seems to be no output, neither in Torque's
> BasePeer nor in the approp. village classes. Any idea? (Is there,
> for example, a possibility to grab every statement that passes my
> JDBC connection?)
>
>
> I followed these steps to get log4j to work:
>
> 1) added log4j-1.2.8.jar to my runtime classpath.
>
> 2) added
>      PropertyConfigurator.configure("path/to/Torque.properties");
>    to my servlet's init()-method
>
> 3) changed Torque.properties to the following:
>
> ---snip---
> # Set root logger level to [DEBUG|INFO|WARN|ERROR|FATAL] and its
> appenders
> log4j.rootLogger=WARN, TORQUE
> # or: log4j.rootLogger=DEBUG, TORQUE
> # or: log4j.rootLogger=DEBUG, TORQUE, FILE
> # etc...
>
> # TORQUE logger to STDOUT
> log4j.appender.TORQUE=org.apache.log4j.ConsoleAppender
> log4j.appender.TORQUE.layout=org.apache.log4j.SimpleLayout
> # log BasePeer at DEBUG level
> log4j.logger.org.apache.torque.util.BasePeer = DEBUG
>
> # a FILE logger
> #log4j.appender.FILE=org.apache.log4j.FileAppender
> #log4j.appender.FILE.layout=org.apache.log4j.SimpleLayout
> #log4j.appender.FILE.file = torque.log
> #log4j.appender.FILE.append = true
> ---snip---
>
> Puh, spent another too-much-time on configuration... :-|
>
>
> Greetings,
>
> Daniel
>



---------------------------------------------------------------------
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