ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Boden <list...@pandora.be>
Subject Re: logj4 and ibatis - How to log SQL statements [OT]
Date Mon, 11 Apr 2005 19:50:42 GMT

You're probably suffering from a known problem with
commons-logging.jar:
http://www.qos.ch/logging/thinkAgain.jsp
http://www.qos.ch/logging/classloader.jsp

Been bitten a few times myself with this problem. Try to make sure,
there's only one version of log4j in your environment. 

Regards,
Sven Boden

On Mon, 11 Apr 2005 12:36:33 +0200, you wrote:

>Thank you.
>
>It doesn't work for me with Tomcat, but it works fine with SunOne web 
>server, so I think it is a misconfiguration issue with 
>commons-logging.jar (I must put it under WEB-INF/lib when working with 
>SunOne, but I must remove it in order to get Tomcat working ¿?)
>
>Thank you one more time,
>Guido García Bernardo.
>
>Brent Ryan wrote:
>
>>Mine will log SQL statements fine if I do this:
>>
>># Set the root logging level for the application here.
>># DEBUG < INFO < WARN < ERROR < FATAL
>># The below value contains the logging level followed by a list of appenders
>>log4j.rootLogger=DEBUG, stdout
>>
>># The stdout appender sends all logging info to the console
>>log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>>log4j.appender.stdout.layout.ConversionPattern=%p:%d - %m%n
>>#log4j.appender.stdout.layout.ConversionPattern=%p:%d [%t] - %C:%M:%L - %m%n
>>
>>Brent
>>
>>
>>-----Original Message-----
>>From:	Guido García Bernardo [mailto:ggarciab@itdeusto.com]
>>Sent:	Fri 4/8/2005 1:30 AM
>>To:	ibatis-user-java@incubator.apache.org
>>Cc:	
>>Subject:	logj4 and ibatis - How to log SQL statements
>>Hi,
>>
>>I need to log SQL statements.  I'm using tomcat 4.1.31 + ibatis 2.0.9 + 
>>log4j 1.2.8 as described in "ibatis SQL Maps Developer Guide version 
>>2.0" (June 17, 2004):
>>
>>I have put the log4j.properties file in WEB-INF/classes folder (¿is this 
>>ok?), and it seems to work because if I do 
>>Logger.getRootLogger().debug("foo"); it works fine.
>>Any idea of why we are not able to see SQL statements?
>>
>>log4j.rootLogger=DEBUG, consola
>>
>>log4j.logger.com.ibatis=DEBUG, consola
>>log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG, consola
>>log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG, consola
>>log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG, 
>>consola
>>log4j.logger.java.sql.Connection=DEBUG, consola
>>log4j.logger.java.sql.Statement=DEBUG, consola
>>log4j.logger.java.sql.PreparedStatement=DEBUG, consola
>>log4j.logger.java.sql.ResultSet=DEBUG, consola
>>
>>### Appenders
>>log4j.appender.consola=org.apache.log4j.ConsoleAppender
>>log4j.appender.consola.layout=org.apache.log4j.PatternLayout
>>log4j.appender.consola.layout.ConversionPattern=%3p %d{ABSOLUTE} [%t 
>>%c{1}] - %m%n
>>
>>Thank you very much in advance,
>>Guido García Bernardo.
>>  
>>
>


Mime
View raw message