ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: iBATIS logging
Date Mon, 21 Apr 2008 15:51:58 GMT
Commons logging (JCL) is insidious and is almost always in the classpath
(WebSphere, Tomcat, etc. always have JCL in the classpath).  Try this line
of code to force iBATIS to use log4j:

com.ibatis.common.logging.LogFactory.selectLog4JLogging();

You should execute this at application startup - before any other iBATIS
activity.

Jeff Butler

On Mon, Apr 21, 2008 at 10:13 AM, Filipe David Manana <fdmanana@ieee.org>
wrote:

> Hi,
>
> I am trying to log, with Log4J 1.2.15, all iBATIS access to the database
> (sent queries, errors, etc). But nothing is being logged. My Log4J config
> (an excerpt):
>
> logs.dir=${catalina.home}/logs
> >
> > log4j.logger.com.ibatis=DEBUG, sqlLogFile
> > log4j.logger.java.sql=DEBUG, sqlLogFile
> >
> > # do not duplicate entries to the root log
> > log4j.additivity.com.ibatis = false
> > log4j.additivity.java.sql = false
> >
> > log4j.appender.sqlLogFile=org.apache.log4j.RollingFileAppender
> > log4j.appender.sqlLogFile.File=${logs.dir}/sql.log
> > log4j.appender.sqlLogFile.MaxFileSize=5MB
> > log4j.appender.sqlLogFile.MaxBackupIndex=20
> > log4j.appender.sqlLogFile.ImmediateFlush=true
> > log4j.appender.sqlLogFile.layout=org.apache.log4j.PatternLayout
> > log4j.appender.sqlLogFile.layout.ConversionPattern=[%p %C %d{dd MMM yyyy
> > HH:mm:ss}] %m%n
> >
>
> My log file remains empty. I have been googling and some people say to
> remove commons-logging from the classpath. I don't it in my classpath,
> although the problem persists.
> Any suggestion? Am I doing something wrong?
>
> cheers
>
> --
> Filipe David Manana,
> fdmanana@ieee.org
>
> "The cruellest lies are often told in silence."

Mime
View raw message