You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Eugeny N Dzhurinsky <eu...@jdevelop.com> on 2005/08/03 12:30:45 UTC

SQL logging

Is there any way to view the queries the iBATIS generates? I tried to set up
the java.sql=DEBUG, in log4j, but no luck for now.

-- 
Eugene N Dzhurinsky

Re: SQL logging

Posted by Marco Berri <ma...@bluestudio.it>.
Hi!

I Use this (in log4j.xml) :

	 <appender name="java-sql" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="usr/sql/sql.log" />
		<param name="Threshold" value="ALL"/>
		<param name="MaxFileSize" value="1MB"/>
		<param name="MaxBackupIndex" value="5"/>
         	<layout class="org.apache.log4j.PatternLayout">
         	    <param name="ConversionPattern" value="%-5p [%d{yyyy-MM-dd 
HH:mm:ss}] %x %c [%l] - %m%n"/>
         	</layout>
     </appender>

  	<logger name="java.sql" additivity="true">
        <appender-ref ref="java-sql" />
	</logger>


by!!

Marco Berri
	

Eugeny N Dzhurinsky wrote:
> Is there any way to view the queries the iBATIS generates? I tried to set up
> the java.sql=DEBUG, in log4j, but no luck for now.
> 

Re: SQL logging

Posted by Darek Dober <do...@op.pl>.
Try to include commons-logging.
I spent some time searching the reason:)
Ibatis depends on it, yet

Darek Dober
----- Original Message ----- 
From: "Eugeny N Dzhurinsky" <eu...@jdevelop.com>
To: <us...@ibatis.apache.org>
Sent: Wednesday, August 03, 2005 12:30 PM
Subject: SQL logging


> Is there any way to view the queries the iBATIS generates? I tried to set
up
> the java.sql=DEBUG, in log4j, but no luck for now.
>
> -- 
> Eugene N Dzhurinsky


Re: SQL logging

Posted by Ren Lixin <re...@gmail.com>.
hi, I use p6spy, try it & enjoy it.
 http://sourceforge.net/projects/p6spy/
 :)

 2005/8/3, Eugeny N Dzhurinsky <eu...@jdevelop.com>: 
> 
> Is there any way to view the queries the iBATIS generates? I tried to set 
> up
> the java.sql=DEBUG, in log4j, but no luck for now.
> 
> --
> Eugene N Dzhurinsky
>

Re: SQL logging

Posted by Daniel Henrique Ferreira e Silva <dh...@gmail.com>.
Hi Vahan,

You'll find all necessary upgrade information on iBATIS documentation.
Just point your browser to http://ibatis.apache.org

Cheers,
Daniel Silva.

On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> I am planning for it.
> do you have a link handy to a complete reference on the upgrade instructions
> from v1.0 to the latest?
> I need to evaluate the effort.
> 
> Vahan Amirbekyan
> ISG Business Systems
> The World Bank
> 1850 I Street, NW, Washington, DC 20433
> Tel: 202 / 458-9642 (office)
> vamirbekyan@worldbank.org
> 
> 
> 
> 
>              Daniel Henrique
>              Ferreira e
>              Silva                                                           To
>              <dhsilva@gmail.         user-java@ibatis.apache.org
>              com>                                                            cc
> 
>              08/03/2005                                                 Subject
>              05:16 PM                Re: SQL logging
> 
> 
>              Please respond
>                    to
>              user-java@ibati
>               s.apache.org
> 
> 
> 
> 
> 
> 
> Hi Vamirberkyan,
> 
> By the way, why don't you try iBATIS latest version? Version 1.x was
> cool, but version 2.x is super cool ;-)
> 
> It has a lot of features that i bet you couldn't live without them
> after getting introduced to.
> 
> My 2 cents,
> Daniel Silva.
> 
> 
> 
> On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> > thank you Zhongmin!
> > I was two clicks away from having logs I needed after receiving your message!
> >
> >
> >
> >
> >              Zhongmin Chen
> >              <zhongmin.chen@
> >              gmail.com>
> To
> >                                      user-java@ibatis.apache.org
> >              08/03/2005
> cc
> >              03:03 PM
> >
> Subject
> >                                      Re: SQL logging
> >              Please respond
> >                    to
> >              user-java@ibati
> >               s.apache.org
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > Having something similar to the following in log4j.properties will help.
> >
> > Regards,
> > Zhongmin
> >
> > # Global logging configuration
> > log4j.rootLogger=error,stdout
> > # log4j.rootLogger=debug,ibatisFile
> >
> > # Console output...
> > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
> >
> > ########### for ibatis
> > # SqlMap logging configuration...
> > log4j.logger.com.ibatis=DEBUG,ibatisFile
> > log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
> > log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
> >
> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
> > log4j.logger.java.sql.Connection=DEBUG,ibatisFile
> > log4j.logger.java.sql.Statement=DEBUG,ibatisFile
> > log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
> > log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
> >
> > log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
> > log4j.appender.ibatisFile.MaxFileSize=6MB
> > log4j.appender.ibatisFile.immediateFlush=true
> > log4j.appender.ibatisFile.MaxBackupIndex=3
> > log4j.appender.ibatisFile.File=<log file full path>
> > log4j.appender.ibatisFile.Threshold=DEBUG
> > log4j.appender.ibatisFile.append=true
> > log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
> > log4j.appender.ibatisFile.layout.ConversionPattern=%d{DATE} %c{3} %p - %m%n
> >
> >
> >
> > On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> > > I am using iBatis 1.0
> > > any clue on to get iBatis1.0 to start logging generated queries?
> > >
> > > I have
> > > com.ibatis=DEBUG
> > > in log4j.properties that does not help
> > >
> > >
> > >
> > >
> > >
> > >
> > >              TNO
> > >              <tnodev@free.fr
> > >              >
> > To
> > >                                      user-java@ibatis.apache.org
> > >              08/03/2005
> > cc
> > >              07:30 AM
> > >
> > Subject
> > >                                      Re: SQL logging
> > >              Please respond
> > >                    to
> > >              user-java@ibati
> > >               s.apache.org
> > >
> > >
> > >
> > >
> > >
> > >
> > > Try
> > > <category name="com.ibatis">
> > > <priority value="debug" />
> > > </category>
> > >
> > >
> > > Eugeny N Dzhurinsky a écrit :
> > >
> > > >Is there any way to view the queries the iBATIS generates? I tried to set
> up
> > > >the java.sql=DEBUG, in log4j, but no luck for now.
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> 
> 
> 
>

Re: daoManager start/end/commit transaction problem - solved:)

Posted by Darek Dober <do...@op.pl>.
Thanks for your answer,I solved the problem
It is difficult to say, but It was very obvious fault:)


By the way I have one dao manager.

Problem was that, I had my code different, than I wrote in my post.

I didn't excecute endTransaction() (It was in my catch exception section instead of finally section), so after commitTransaction, transaction was still in progress.

I was tricked by the fact, that commit transaction should release all resources and locks. Database transaction was commited, but still locked the tables

Can you explain that magic. I always thought, that commit releases resources?

Anyway thanks for help

Best regards
Darek Dober

----- Original Message ----- 
  From: Clinton Begin 
  To: user-java@ibatis.apache.org 
  Sent: Friday, August 05, 2005 1:09 AM
  Subject: Re: daoManager start/end/commit transaction problem



  Three things:

  1) You should only have one DAO manager, even with multiple databases.

  2) In my opinion, your transactions should be at the service level.  Make more coarse grained service methods that demarcate transactional scope.  

  3) Be very careful with multiple start/commit/end blocks.  You should consider a global transaction manager if you're working with multiple databases.

  Cheers,
  Clinton



  On 8/4/05, Darek Dober <do...@op.pl> wrote:
    Hi

    I use petstore as example so I have:

    affairService and debtorService which gives me method like
    updateAffair(Domain affair) and updateDebtor(Domain debtor)

    Now I want them to be executed in one transaction 

    I try to do something like this

    update() {
    ...
    try {
    affairService.getDaoManager().startTransaction();

    affairService.updateAffair(affair);
    debtorService.updateDebtor(debtor);

    affairService.getDaoManager ().commitTransaction();

    } catch (Exception ex) {
    ..
    } finally {
    affairService.getDaoManager().endTransaction();
    }

    But after that operation i have some locks in database.

    Is this the correct way, or should I use start/commit/endTransaction() 
    method at the lower level of  ...sqlMapDao (i.e affairSqlMapDao)
    Or maybe I should do it in pairs like:
    affairService.getDaoManager().startTransaction();
    debtorService.getDaoManager().startTransaction();

    ..
    affairService.getDaoManager().commitTransaction();
    debtorService.getDaoManager().commitTransaction();


    Darek Dober




Re: daoManager start/end/commit transaction problem

Posted by Clinton Begin <cl...@gmail.com>.
Three things:

1) You should only have one DAO manager, even with multiple databases.

2) In my opinion, your transactions should be at the service level. Make 
more coarse grained service methods that demarcate transactional scope. 

3) Be very careful with multiple start/commit/end blocks. You should 
consider a global transaction manager if you're working with multiple 
databases.

Cheers,
Clinton


On 8/4/05, Darek Dober <do...@op.pl> wrote:
> 
> Hi
> 
> I use petstore as example so I have:
> 
> affairService and debtorService which gives me method like
> updateAffair(Domain affair) and updateDebtor(Domain debtor)
> 
> Now I want them to be executed in one transaction
> 
> I try to do something like this
> 
> update() {
> ...
> try {
> affairService.getDaoManager().startTransaction();
> 
> affairService.updateAffair(affair);
> debtorService.updateDebtor(debtor);
> 
> affairService.getDaoManager().commitTransaction();
> 
> } catch (Exception ex) {
> ..
> } finally {
> affairService.getDaoManager().endTransaction();
> }
> 
> But after that operation i have some locks in database.
> 
> Is this the correct way, or should I use start/commit/endTransaction()
> method at the lower level of ...sqlMapDao (i.e affairSqlMapDao)
> Or maybe I should do it in pairs like:
> affairService.getDaoManager().startTransaction();
> debtorService.getDaoManager().startTransaction();
> 
> ..
> affairService.getDaoManager().commitTransaction();
> debtorService.getDaoManager().commitTransaction();
> 
> 
> Darek Dober
> 
>

daoManager start/end/commit transaction problem

Posted by Darek Dober <do...@op.pl>.
Hi

I use petstore as example so I have:

affairService and debtorService which gives me method like
updateAffair(Domain affair) and updateDebtor(Domain debtor)

Now I want them to be executed in one transaction

I try to do something like this

update() {
...
try {
affairService.getDaoManager().startTransaction();

affairService.updateAffair(affair);
debtorService.updateDebtor(debtor);

affairService.getDaoManager().commitTransaction();

} catch (Exception ex) {
..
} finally {
affairService.getDaoManager().endTransaction();
}

But after that operation i have some locks in database.

Is this the correct way, or should I use start/commit/endTransaction()
method at the lower level of  ...sqlMapDao (i.e affairSqlMapDao)
Or maybe I should do it in pairs like:
affairService.getDaoManager().startTransaction();
debtorService.getDaoManager().startTransaction();

..
affairService.getDaoManager().commitTransaction();
debtorService.getDaoManager().commitTransaction();


Darek Dober


Re: SQL logging

Posted by va...@worldbank.org.
I am planning for it.
do you have a link handy to a complete reference on the upgrade instructions
from v1.0 to the latest?
I need to evaluate the effort.

Vahan Amirbekyan
ISG Business Systems
The World Bank
1850 I Street, NW, Washington, DC 20433
Tel: 202 / 458-9642 (office)
vamirbekyan@worldbank.org



                                                                                
             Daniel Henrique                                                    
             Ferreira e                                                         
             Silva                                                           To 
             <dhsilva@gmail.         user-java@ibatis.apache.org                
             com>                                                            cc 
                                                                                
             08/03/2005                                                 Subject 
             05:16 PM                Re: SQL logging                            
                                                                                
                                                                                
             Please respond                                                     
                   to                                                           
             user-java@ibati                                                    
              s.apache.org                                                      
                                                                                
                                                                                




Hi Vamirberkyan,

By the way, why don't you try iBATIS latest version? Version 1.x was
cool, but version 2.x is super cool ;-)

It has a lot of features that i bet you couldn't live without them
after getting introduced to.

My 2 cents,
Daniel Silva.



On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> thank you Zhongmin!
> I was two clicks away from having logs I needed after receiving your message!
>
>
>
>
>              Zhongmin Chen
>              <zhongmin.chen@
>              gmail.com>
To
>                                      user-java@ibatis.apache.org
>              08/03/2005
cc
>              03:03 PM
>
Subject
>                                      Re: SQL logging
>              Please respond
>                    to
>              user-java@ibati
>               s.apache.org
>
>
>
>
>
>
> Hi,
>
> Having something similar to the following in log4j.properties will help.
>
> Regards,
> Zhongmin
>
> # Global logging configuration
> log4j.rootLogger=error,stdout
> # log4j.rootLogger=debug,ibatisFile
>
> # Console output...
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
>
> ########### for ibatis
> # SqlMap logging configuration...
> log4j.logger.com.ibatis=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
>
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
>
> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
> log4j.appender.ibatisFile.MaxFileSize=6MB
> log4j.appender.ibatisFile.immediateFlush=true
> log4j.appender.ibatisFile.MaxBackupIndex=3
> log4j.appender.ibatisFile.File=<log file full path>
> log4j.appender.ibatisFile.Threshold=DEBUG
> log4j.appender.ibatisFile.append=true
> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
> log4j.appender.ibatisFile.layout.ConversionPattern=%d{DATE} %c{3} %p - %m%n
>
>
>
> On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> > I am using iBatis 1.0
> > any clue on to get iBatis1.0 to start logging generated queries?
> >
> > I have
> > com.ibatis=DEBUG
> > in log4j.properties that does not help
> >
> >
> >
> >
> >
> >
> >              TNO
> >              <tnodev@free.fr
> >              >
> To
> >                                      user-java@ibatis.apache.org
> >              08/03/2005
> cc
> >              07:30 AM
> >
> Subject
> >                                      Re: SQL logging
> >              Please respond
> >                    to
> >              user-java@ibati
> >               s.apache.org
> >
> >
> >
> >
> >
> >
> > Try
> > <category name="com.ibatis">
> > <priority value="debug" />
> > </category>
> >
> >
> > Eugeny N Dzhurinsky a écrit :
> >
> > >Is there any way to view the queries the iBATIS generates? I tried to set
up
> > >the java.sql=DEBUG, in log4j, but no luck for now.
> > >
> > >
> > >
> >
> >
> > --
> > Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
> >
> >
> >
> >
> >
>
>
>
>




Re: SQL logging

Posted by Daniel Henrique Ferreira e Silva <dh...@gmail.com>.
Hi Vamirberkyan,

By the way, why don't you try iBATIS latest version? Version 1.x was
cool, but version 2.x is super cool ;-)

It has a lot of features that i bet you couldn't live without them
after getting introduced to.

My 2 cents,
Daniel Silva.



On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> thank you Zhongmin!
> I was two clicks away from having logs I needed after receiving your message!
> 
> 
> 
> 
>              Zhongmin Chen
>              <zhongmin.chen@
>              gmail.com>                                                      To
>                                      user-java@ibatis.apache.org
>              08/03/2005                                                      cc
>              03:03 PM
>                                                                         Subject
>                                      Re: SQL logging
>              Please respond
>                    to
>              user-java@ibati
>               s.apache.org
> 
> 
> 
> 
> 
> 
> Hi,
> 
> Having something similar to the following in log4j.properties will help.
> 
> Regards,
> Zhongmin
> 
> # Global logging configuration
> log4j.rootLogger=error,stdout
> # log4j.rootLogger=debug,ibatisFile
> 
> # Console output...
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
> 
> ########### for ibatis
> # SqlMap logging configuration...
> log4j.logger.com.ibatis=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
> 
> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
> log4j.appender.ibatisFile.MaxFileSize=6MB
> log4j.appender.ibatisFile.immediateFlush=true
> log4j.appender.ibatisFile.MaxBackupIndex=3
> log4j.appender.ibatisFile.File=<log file full path>
> log4j.appender.ibatisFile.Threshold=DEBUG
> log4j.appender.ibatisFile.append=true
> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
> log4j.appender.ibatisFile.layout.ConversionPattern=%d{DATE} %c{3} %p - %m%n
> 
> 
> 
> On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> > I am using iBatis 1.0
> > any clue on to get iBatis1.0 to start logging generated queries?
> >
> > I have
> > com.ibatis=DEBUG
> > in log4j.properties that does not help
> >
> >
> >
> >
> >
> >
> >              TNO
> >              <tnodev@free.fr
> >              >
> To
> >                                      user-java@ibatis.apache.org
> >              08/03/2005
> cc
> >              07:30 AM
> >
> Subject
> >                                      Re: SQL logging
> >              Please respond
> >                    to
> >              user-java@ibati
> >               s.apache.org
> >
> >
> >
> >
> >
> >
> > Try
> > <category name="com.ibatis">
> > <priority value="debug" />
> > </category>
> >
> >
> > Eugeny N Dzhurinsky a écrit :
> >
> > >Is there any way to view the queries the iBATIS generates? I tried to set up
> > >the java.sql=DEBUG, in log4j, but no luck for now.
> > >
> > >
> > >
> >
> >
> > --
> > Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
> >
> >
> >
> >
> >
> 
> 
> 
>

Re: SQL logging

Posted by va...@worldbank.org.
thank you Zhongmin!
I was two clicks away from having logs I needed after receiving your message!



                                                                                
             Zhongmin Chen                                                      
             <zhongmin.chen@                                                    
             gmail.com>                                                      To 
                                     user-java@ibatis.apache.org                
             08/03/2005                                                      cc 
             03:03 PM                                                           
                                                                        Subject 
                                     Re: SQL logging                            
             Please respond                                                     
                   to                                                           
             user-java@ibati                                                    
              s.apache.org                                                      
                                                                                
                                                                                




Hi,

Having something similar to the following in log4j.properties will help.

Regards,
Zhongmin

# Global logging configuration
log4j.rootLogger=error,stdout
# log4j.rootLogger=debug,ibatisFile

# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

########### for ibatis
# SqlMap logging configuration...
log4j.logger.com.ibatis=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
log4j.logger.java.sql.Connection=DEBUG,ibatisFile
log4j.logger.java.sql.Statement=DEBUG,ibatisFile
log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile

log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
log4j.appender.ibatisFile.MaxFileSize=6MB
log4j.appender.ibatisFile.immediateFlush=true
log4j.appender.ibatisFile.MaxBackupIndex=3
log4j.appender.ibatisFile.File=<log file full path>
log4j.appender.ibatisFile.Threshold=DEBUG
log4j.appender.ibatisFile.append=true
log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
log4j.appender.ibatisFile.layout.ConversionPattern=%d{DATE} %c{3} %p - %m%n



On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> I am using iBatis 1.0
> any clue on to get iBatis1.0 to start logging generated queries?
>
> I have
> com.ibatis=DEBUG
> in log4j.properties that does not help
>
>
>
>
>
>
>              TNO
>              <tnodev@free.fr
>              >
To
>                                      user-java@ibatis.apache.org
>              08/03/2005
cc
>              07:30 AM
>
Subject
>                                      Re: SQL logging
>              Please respond
>                    to
>              user-java@ibati
>               s.apache.org
>
>
>
>
>
>
> Try
> <category name="com.ibatis">
> <priority value="debug" />
> </category>
>
>
> Eugeny N Dzhurinsky a écrit :
>
> >Is there any way to view the queries the iBATIS generates? I tried to set up
> >the java.sql=DEBUG, in log4j, but no luck for now.
> >
> >
> >
>
>
> --
> Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
>
>
>
>
>




Re: SQL logging

Posted by Zhongmin Chen <zh...@gmail.com>.
Hi,

Having something similar to the following in log4j.properties will help.

Regards,
Zhongmin

# Global logging configuration
log4j.rootLogger=error,stdout
# log4j.rootLogger=debug,ibatisFile

# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

########### for ibatis
# SqlMap logging configuration...
log4j.logger.com.ibatis=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
log4j.logger.java.sql.Connection=DEBUG,ibatisFile
log4j.logger.java.sql.Statement=DEBUG,ibatisFile
log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile

log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
log4j.appender.ibatisFile.MaxFileSize=6MB
log4j.appender.ibatisFile.immediateFlush=true
log4j.appender.ibatisFile.MaxBackupIndex=3
log4j.appender.ibatisFile.File=<log file full path>
log4j.appender.ibatisFile.Threshold=DEBUG
log4j.appender.ibatisFile.append=true
log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
log4j.appender.ibatisFile.layout.ConversionPattern=%d{DATE} %c{3} %p - %m%n



On 8/3/05, vamirbekyan@worldbank.org <va...@worldbank.org> wrote:
> I am using iBatis 1.0
> any clue on to get iBatis1.0 to start logging generated queries?
> 
> I have
> com.ibatis=DEBUG
> in log4j.properties that does not help
> 
> 
> 
> 
> 
> 
>              TNO
>              <tnodev@free.fr
>              >                                                               To
>                                      user-java@ibatis.apache.org
>              08/03/2005                                                      cc
>              07:30 AM
>                                                                         Subject
>                                      Re: SQL logging
>              Please respond
>                    to
>              user-java@ibati
>               s.apache.org
> 
> 
> 
> 
> 
> 
> Try
> <category name="com.ibatis">
> <priority value="debug" />
> </category>
> 
> 
> Eugeny N Dzhurinsky a écrit :
> 
> >Is there any way to view the queries the iBATIS generates? I tried to set up
> >the java.sql=DEBUG, in log4j, but no luck for now.
> >
> >
> >
> 
> 
> --
> Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...
> 
> 
> 
> 
>

Re: SQL logging

Posted by va...@worldbank.org.
I am using iBatis 1.0
any clue on to get iBatis1.0 to start logging generated queries?

I have
com.ibatis=DEBUG
in log4j.properties that does not help





                                                                                
             TNO                                                                
             <tnodev@free.fr                                                    
             >                                                               To 
                                     user-java@ibatis.apache.org                
             08/03/2005                                                      cc 
             07:30 AM                                                           
                                                                        Subject 
                                     Re: SQL logging                            
             Please respond                                                     
                   to                                                           
             user-java@ibati                                                    
              s.apache.org                                                      
                                                                                
                                                                                




Try
<category name="com.ibatis">
<priority value="debug" />
</category>


Eugeny N Dzhurinsky a écrit :

>Is there any way to view the queries the iBATIS generates? I tried to set up
>the java.sql=DEBUG, in log4j, but no luck for now.
>
>
>


--
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...





Re: SQL logging

Posted by TNO <tn...@free.fr>.
Try
<category name="com.ibatis">
<priority value="debug" />
</category>


Eugeny N Dzhurinsky a écrit :

>Is there any way to view the queries the iBATIS generates? I tried to set up
>the java.sql=DEBUG, in log4j, but no luck for now.
>
>  
>


-- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs...



Cache for QuerywithrowsHandler

Posted by Marco Berri <ma...@bluestudio.it>.
Hi!

the caching method (eg. oscache) is used on low level api with 
QuerywithrowsHandler ?

thanks