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 Warren <wa...@clarksnutrition.com> on 2007/12/01 00:16:41 UTC

RE: Ibatis java.sql and log4j

Thanks, I will quit knocking myself out trying to get JDBC to log by itself.
p6spy, will this allow me to capture SQL statements. I am trying to rewrite
an old servlet/jsp app that is no longer supported. It would sure speed
things up if I could get my hands on the SQL. I do not have the source code
and I have decompiled it, but its a mess. I am trying to get request level
logging on the db side, but have not had any luck. It uses Sybase SQL
Anywhere 8.0.2. Any sugestions?
  -----Original Message-----
  From: Jeff Butler [mailto:jeffgbutler@gmail.com]
  Sent: Friday, November 30, 2007 1:42 PM
  To: user-java@ibatis.apache.org
  Subject: Re: Ibatis java.sql and log4j


  iBATIS logs to the java.sql objects - so all the java.sql logging entries
you see are actually iBATIS entries - NOT standard java.sql entries.  This
is a <sarcasm>feature</sarcasm> of iBATIS and will not be available in other
environments.

  Many JDBC drivers can be configured to do logging, or you can use p6spy,
in other environments.

  Jeff Butler





  On Nov 30, 2007 3:33 PM, Warren <wa...@clarksnutrition.com> wrote:

    I have an app that uses Ibatis and log4j to log Ibatis and java.sql. It
logs
    perfectly. I have another app that does not use Ibatis and I can not get
    log4j to log java.sql. I know that logging is working and log4j has
    initialized logging for java.sql.

    Is Ibatis working with java.sql somehow so that log4j can log SQL
    statements, or should you be able to log SQL statement and java.sql
without
    Ibatis?

    Thanks,

    Warren




RE: Ibatis java.sql and log4j

Posted by Tom Henricksen <To...@A-t-g.com>.
And yes it will capture your SQL

Here is some of our output in our console

 

p6spy - 1196689443367|0|2|statement||select * from sysibm.SYSDUMMY1

 

-----Original Message-----
From: Tom Henricksen [mailto:TomH@A-t-g.com] 
Sent: Monday, December 03, 2007 7:42 AM
To: user-java@ibatis.apache.org
Subject: RE: Ibatis java.sql and log4j

 

P6spy is pretty easy to setup.

 

http://www.p6spy.com/documentation/index.htm

 

 

from what I remember you basically point your system to there driver

 

driver=com.p6spy.engine.spy.P6SpyDriver

 

Then setup the spy.properties to point to your drvier.




# ibm db2 driver

# realdriver=COM.ibm.db2.jdbc.net.DB2Driver

realdriver=com.ibm.db2.jcc.DB2Driver

 

 So in your case the Sybase driver.

 

-----Original Message-----
From: Warren [mailto:warren@clarksnutrition.com] 
Sent: Friday, November 30, 2007 5:17 PM
To: user-java@ibatis.apache.org
Subject: RE: Ibatis java.sql and log4j

 

Thanks, I will quit knocking myself out trying to get JDBC to log by
itself. p6spy, will this allow me to capture SQL statements. I am trying
to rewrite an old servlet/jsp app that is no longer supported. It would
sure speed things up if I could get my hands on the SQL. I do not have
the source code and I have decompiled it, but its a mess. I am trying to
get request level logging on the db side, but have not had any luck. It
uses Sybase SQL Anywhere 8.0.2. Any sugestions?

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Friday, November 30, 2007 1:42 PM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis java.sql and log4j

iBATIS logs to the java.sql objects - so all the java.sql logging
entries you see are actually iBATIS entries - NOT standard java.sql
entries.  This is a <sarcasm>feature</sarcasm> of iBATIS and will not be
available in other environments. 

 

Many JDBC drivers can be configured to do logging, or you can use p6spy,
in other environments.

 

Jeff Butler

 

 



 

On Nov 30, 2007 3:33 PM, Warren <wa...@clarksnutrition.com> wrote:

I have an app that uses Ibatis and log4j to log Ibatis and java.sql. It
logs
perfectly. I have another app that does not use Ibatis and I can not get

log4j to log java.sql. I know that logging is working and log4j has
initialized logging for java.sql.

Is Ibatis working with java.sql somehow so that log4j can log SQL
statements, or should you be able to log SQL statement and java.sql
without
Ibatis?

Thanks,

Warren

 


RE: Ibatis java.sql and log4j

Posted by Tom Henricksen <To...@A-t-g.com>.
P6spy is pretty easy to setup.

 

http://www.p6spy.com/documentation/index.htm

 

 

from what I remember you basically point your system to there driver

 

driver=com.p6spy.engine.spy.P6SpyDriver

 

Then setup the spy.properties to point to your drvier.




# ibm db2 driver

# realdriver=COM.ibm.db2.jdbc.net.DB2Driver

realdriver=com.ibm.db2.jcc.DB2Driver

 

 So in your case the Sybase driver.

 

-----Original Message-----
From: Warren [mailto:warren@clarksnutrition.com] 
Sent: Friday, November 30, 2007 5:17 PM
To: user-java@ibatis.apache.org
Subject: RE: Ibatis java.sql and log4j

 

Thanks, I will quit knocking myself out trying to get JDBC to log by
itself. p6spy, will this allow me to capture SQL statements. I am trying
to rewrite an old servlet/jsp app that is no longer supported. It would
sure speed things up if I could get my hands on the SQL. I do not have
the source code and I have decompiled it, but its a mess. I am trying to
get request level logging on the db side, but have not had any luck. It
uses Sybase SQL Anywhere 8.0.2. Any sugestions?

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Friday, November 30, 2007 1:42 PM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis java.sql and log4j

iBATIS logs to the java.sql objects - so all the java.sql logging
entries you see are actually iBATIS entries - NOT standard java.sql
entries.  This is a <sarcasm>feature</sarcasm> of iBATIS and will not be
available in other environments. 

 

Many JDBC drivers can be configured to do logging, or you can use p6spy,
in other environments.

 

Jeff Butler

 

 



 

On Nov 30, 2007 3:33 PM, Warren <wa...@clarksnutrition.com> wrote:

I have an app that uses Ibatis and log4j to log Ibatis and java.sql. It
logs
perfectly. I have another app that does not use Ibatis and I can not get

log4j to log java.sql. I know that logging is working and log4j has
initialized logging for java.sql.

Is Ibatis working with java.sql somehow so that log4j can log SQL
statements, or should you be able to log SQL statement and java.sql
without
Ibatis?

Thanks,

Warren

 


Re: Ibatis java.sql and log4j

Posted by Christopher Lamey <cl...@localmatters.com>.
>From the p6spy website:

"P6Log intercepts and logs the database statements of any application that
uses JDBC. This application is particularly useful for developers to monitor
the SQL statements..."

You could also use a profiler like Jprofiler or YourKit, both of which have
the ability to log JDBC statements.

On 11/30/07 4:16 PM, "Warren" <wa...@clarksnutrition.com> wrote:

> Thanks, I will quit knocking myself out trying to get JDBC to log by itself.
> p6spy, will this allow me to capture SQL statements. I am trying to rewrite
> an old servlet/jsp app that is no longer supported. It would sure speed
> things up if I could get my hands on the SQL. I do not have the source code
> and I have decompiled it, but its a mess. I am trying to get request level
> logging on the db side, but have not had any luck. It uses Sybase SQL
> Anywhere 8.0.2. Any sugestions?
>   -----Original Message-----
>   From: Jeff Butler [mailto:jeffgbutler@gmail.com]
>   Sent: Friday, November 30, 2007 1:42 PM
>   To: user-java@ibatis.apache.org
>   Subject: Re: Ibatis java.sql and log4j
> 
> 
>   iBATIS logs to the java.sql objects - so all the java.sql logging entries
> you see are actually iBATIS entries - NOT standard java.sql entries.  This
> is a <sarcasm>feature</sarcasm> of iBATIS and will not be available in other
> environments.
> 
>   Many JDBC drivers can be configured to do logging, or you can use p6spy,
> in other environments.
> 
>   Jeff Butler
> 
> 
> 
> 
> 
>   On Nov 30, 2007 3:33 PM, Warren <wa...@clarksnutrition.com> wrote:
> 
>     I have an app that uses Ibatis and log4j to log Ibatis and java.sql. It
> logs
>     perfectly. I have another app that does not use Ibatis and I can not get
>     log4j to log java.sql. I know that logging is working and log4j has
>     initialized logging for java.sql.
> 
>     Is Ibatis working with java.sql somehow so that log4j can log SQL
>     statements, or should you be able to log SQL statement and java.sql
> without
>     Ibatis?
> 
>     Thanks,
> 
>     Warren
> 
> 
>