Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 72564 invoked from network); 5 Sep 2007 05:24:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2007 05:24:53 -0000 Received: (qmail 48569 invoked by uid 500); 5 Sep 2007 05:24:37 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 48560 invoked by uid 500); 5 Sep 2007 05:24:37 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 48325 invoked by uid 99); 5 Sep 2007 05:24:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 22:24:35 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rusty.wright@gmail.com designates 209.85.198.189 as permitted sender) Received: from [209.85.198.189] (HELO rv-out-0910.google.com) (209.85.198.189) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2007 05:24:29 +0000 Received: by rv-out-0910.google.com with SMTP id c27so1220283rvf for ; Tue, 04 Sep 2007 22:24:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type; b=MuqHNvXNKsz3g2iTVazvWSeRJGKa6qiY8/6JhhW5Nu0EH5cgWRTx6bWWBWsr5iKJhhbu7uSljzrsnyE9nM/IBqlSOFZ4E2vm/J10PaLnXAgzFFvq53XOXfIjHPzUMdz1ZJbAMCAd0Mt5VCkFhSJxS2RPPxotN6P9iIoPlVqdpws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type; b=Xf3daIAFEt8ge7d3uvrhCijUPGIWf7dOtLDVHKZtuwdnTDUA1Fo/LRmrt7zCf/Mz9aY0jiBSmJfjzj9SPR8ujCJuLBbsDBQQz03b524WJG0G9arZnGWH1xD7AfDMb+pejtahbFkJmyUkc/2yuUbnnnVoMFRLMvAMzUY1Zj7Aq4Q= Received: by 10.141.19.16 with SMTP id w16mr2643108rvi.1188969849192; Tue, 04 Sep 2007 22:24:09 -0700 (PDT) Received: from ?192.168.1.128? ( [64.85.240.99]) by mx.google.com with ESMTPS id g21sm8817560rvb.2007.09.04.22.24.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Sep 2007 22:24:07 -0700 (PDT) Message-ID: <46DE3D74.8040409@gmail.com> Date: Tue, 04 Sep 2007 22:24:04 -0700 From: Rusty Wright User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: Re : Re : Re : Re : Log4j again... sorry References: <678206.4669.qm@web38906.mail.mud.yahoo.com> <46DD0902.9030405@gmail.com> In-Reply-To: <46DD0902.9030405@gmail.com> Content-Type: multipart/alternative; boundary="------------090006050706070509050607" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------090006050706070509050607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit I don't know if this is what is affecting you but I find the log4j properties file format confusing and error prone so I use the xml format. Here is my log4j.xml file: And in my web.xml I have log4jConfigLocation /WEB-INF/log4j.xml org.springframework.web.util.Log4jConfigListener Gilles Schlienger wrote: > Thanks Jeff > Gilles > > ----- Message d'origine ---- > De : Jeff Butler > � : user-java@ibatis.apache.org > Envoy� le : Vendredi, 31 Ao�t 2007, 17h41mn 19s > Objet : Re: Re : Re : Re : Log4j again... sorry > > iBATIS logs almost everything to java.sql logs. The only thing you'll > see in com.ibatis is caching information. Sounds like you've got it > working. > > Jeff Butler > > > > On 8/31/07, *Gilles Schlienger* > wrote: > > Tried that but still no luck. > > java.sql logs work fine though > > But still nothing with com.ibatis.etc... > > Don't know what to try... > > Regards > Gilles > > ----- Message d'origine ---- > De : Brandon Goodin < brandon.goodin@gmail.com > > > � : user-java@ibatis.apache.org > Envoy� le : Vendredi, 31 Ao�t 2007, 16h29mn 44s > Objet : Re: Re : Re : Log4j again... sorry > > > Additionally you could try adding commons-logging to your webapp > classpath and then place the following contents into a > WEB-INF/commons-logging.properties file: > > org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger > > > Brandon > > On 8/31/07, *Brandon Goodin* < brandon.goodin@gmail.com > > wrote: > > 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* < s_gilou@yahoo.com > > 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 > > � : 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 > > � : 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 < s_gilou@yahoo.com > > 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 > > > > > > > ------------------------------------------------------------------------ > 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 --------------090006050706070509050607 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
I don't know if this is what is affecting you but I find the log4j properties file format confusing and error prone so I use the xml format.  Here is my log4j.xml file:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <!-- param entries must come before layout entry -->
    <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
        <param
            name="File"
            value="/tmp/my-app.log"
        />

        <param
            name="MaxFileSize"
            value="2000kb"
        />

        <param
            name="MaxBackupIndex"
            value="9"
        />

        <layout class="org.apache.log4j.PatternLayout">
            <param
                name="ConversionPattern"
                value="%p: %d [%C %M] %m%n"
            />
        </layout>
    </appender>

    <appender name="CONS" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param
                name="ConversionPattern"
                value="%p: %C.%M: %m%n"
            />
        </layout>
    </appender>

    <!-- example of how to change the level and appender        -->
    <!-- for a specific class.                                  -->
    <logger name="com.ibatis">
        <level value="debug" />
        
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="com.ibatis.common.jdbc.SimpleDataSource">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="com.ibatis.sqlmap.engine.cache.CacheModel">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientImpl">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="com.ibatis.sqlmap.engine.builder.xml.SqlMapParser">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="com.ibatis.common.util.StopWatch">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="java.sql.Connection">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="java.sql.Statement">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="java.sql.PreparedStatement">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <logger name="java.sql.ResultSet">
        <level value="debug" />
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <!-- example of how to change the level and appender        -->
    <!-- for a specific class.                                  -->
    <logger name="org.springframework">
        <level value="warn" />
        
        <appender-ref ref="CONS" />
        <appender-ref ref="FILE" />
    </logger>

    <root>
        <level
            value="warn"
        />

        <appender-ref
            ref="CONS"
        />

        <appender-ref
            ref="FILE"
        />
    </root>
</log4j:configuration>

And in my web.xml I have

    <context-param>
        <param-name>
            log4jConfigLocation
        </param-name>

        <param-value>
            /WEB-INF/log4j.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>


Gilles Schlienger wrote:
Thanks Jeff
Gilles

----- Message d'origine ----
De : Jeff Butler <jeffgbutler@gmail.com>
À : user-java@ibatis.apache.org
Envoyé le : Vendredi, 31 Août 2007, 17h41mn 19s
Objet : Re: Re : Re : Re : Log4j again... sorry

iBATIS logs almost everything to java.sql logs.  The only thing you'll see in com.ibatis is caching information.  Sounds like you've got it working.
 
Jeff Butler


 
On 8/31/07, Gilles Schlienger <s_gilou@yahoo.com> wrote:
Tried that but still no luck.

java.sql logs work fine though

But still nothing with com.ibatis.etc...

Don't know what to try...

Regards
Gilles

----- Message d'origine ----
De : Brandon Goodin < brandon.goodin@gmail.com>
À : user-java@ibatis.apache.org
Envoyé le : Vendredi, 31 Août 2007, 16h29mn 44s
Objet : Re: Re : Re : Log4j again... sorry


Additionally you could try adding commons-logging to your webapp classpath and then place the following contents into a WEB-INF/commons-logging.properties file:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

Brandon

On 8/31/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
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 < s_gilou@yahoo.com > 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 <s_gilou@yahoo.com >
À : 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 <lmeadors@apache.org >
À : 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 < s_gilou@yahoo.com> 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



 


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