-
1. Re: Log JDBC calls
vanitas Jun 12, 2003 5:12 PM (in response to mphansen)All DB calls are logged on a debug level by default, so you can try to enable logging on debug (default is on info) in log4j config file (server/*/conf/log4j.xml).
Also please note that logging on debug level kills performance and must not be used on a production system. -
2. Re: Log JDBC calls
mfrost Jun 18, 2003 9:51 AM (in response to mphansen)If you want to turn on just SQL logging you can do the following in log4j.xml:
1. Comment out the Threshold node of the CONSOLE appender - otherwise DEBUG events will never be displayed:
2. Set the root priority to INFO so that we don't create loads of output:
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
3. Finally create a category based upon cmp.jdbc
4. Save the file - after 1 minute the log4j xml is reparsed and hey presto JDBC log messages appear e.g:
14:33:27,834 DEBUG [findByPrimaryKey] Executing SQL: SELECT Company_Id FROM COMPANY_XML WHERE Company_Id=?
Cheers -
3. Re: Log JDBC calls
darranl Jun 18, 2003 10:53 AM (in response to mphansen)Just tried your instructions and they work perfectly.
Would it be worth adding this to the CMP documentation?