Make sure you have log4j in your webapp classpath and then add the following to your log4j.properties file in the root of your WEB-INF/classes directory.
# Rules reminder: # DEBUG < INFO < WARN < ERROR < FATAL # Global logging configuration log4j.rootLogger=WARN, stdout # SqlMap logging configuration... log4j.logger.com.ibatis=DEBUG log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG log4j.logger.java.sql=DEBUG log4j.logger.java.sql.Connection=DEBUG log4j.logger.java.sql.Statement=DEBUG log4j.logger.java.sql.PreparedStatement=DEBUG log4j.logger.java.sql.ResultSet=DEBUG log4j.logger.com.auxilium.web=DEBUG ## Console output... log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p %d %C.%M(): %m%n Brandon On 8/31/07, Gilles Schlienger <[EMAIL PROTECTED]> wrote: > > Something weird: > I created a servlet listener, and added it in my web.xml file. > > In this listener I call: > com.ibatis.common.logging.LogFactory.selectLog4JLogging(); > > Still I get no log in the console or anywhere else... > I use Ibatis with Spring using Spring's Template. > > Regards > Gilles > > ----- Message d'origine ---- > De : Gilles Schlienger <[EMAIL PROTECTED]> > À : user-java@ibatis.apache.org > Envoyé le : Vendredi, 31 Août 2007, 16h10mn 12s > Objet : Re : Log4j again... sorry > > Thanks for your email, > > Still no luck though... > No log happens. > But I can see the SQL request in my MYSQL database logs... > > Regards > Gilles > > ----- Message d'origine ---- > De : Larry Meadors <[EMAIL PROTECTED]> > À : user-java@ibatis.apache.org > Envoyé le : Vendredi, 31 Août 2007, 15h09mn 37s > Objet : Re: Log4j again... sorry > > Try this: > > log4j.logger.java.sql=DEBUG > > Larry > > > On 8/31/07, Gilles Schlienger <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > Sorry to bother you with that subject again, but I can not get any log, > wether from ibatis or from the java.sql BUT I do have spring logs and logs > from my webapp code... My code uses commons-logging AND log4j (I use a > log4j.properties file) > > > > I have read the documentation and I think I understand the dependency of > iBatis with commons-logging... > > > > My webapp uses Tomcat 5.5.23 and iBatis 2.3 > > > > I have in my webapp : > > - in WEB-INF/lib: commons-loggingXX.jar and log4j-XX.jar > > - in WEB-INF/classes: log4j.properties > > with lines: > > log4j.rootLogger=INFO, stdout > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout > > log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n > > ... > > ###### Logging configuration for IBATIS ###### > > # SqlMap logging configuration... > > log4j.logger.com.ibatis=DEBUG > > log4j.logger.java.sql.PreparedStatement=DEBUG > > > > I do get my webapp personnal code logs, but I get nothing for ibatis and > java.sql... > > > > In Tomcat 5.5.23 by default, there is no jar about logging in common/lib > but in the /bin directory there is a commons-logging-api.jar > > > > Could somebody help me please? That would be really appreciated > > Thanks a lot in advance > > Regards > > Gilles > > > > > > > > > > > > > _____________________________________________________________________________ > > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail > > > > > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail > > > > > > > > _____________________________________________________________________________ > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! > Mail >