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 Gwyn Evans <gw...@gmail.com> on 2007/11/13 18:23:41 UTC

Logging oddity

Hi - wonder if anyone can explain this...

I'm testing with ibatis & am finding that if I have

java.sql.Connection = Info
java.sql.PreparedStatement = Debug
java.sql.ResultSet = Debug

then I don't get *any* ibatis logging, but if I change just the
java.sql.Connection value to Debug, then I get the following:

2007-11-13 17:17:57|   |C-1|Connection|Debug|{conn-100000} Connection
2007-11-13 17:17:57|   |C-1|Connection|Debug|{conn-100000} Preparing
Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY ID ASC
LIMIT 1
2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001}
Executing Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY
ID ASC LIMIT 1
2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001} Parameters: []
2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001} Types: []
2007-11-13 17:17:57|   |C-1|ResultSet|Debug|{rset-100002} ResultSet

If I leave Connection as debug & raise PreparedStatement to Info, then
I loose that as expected, but I can't get PreparedStatement without
Connection?

(The settings are from Simple-log, which is where JCL is being adapted
to, so could be an issue with that, I guess...)

/Gwyn

Re: Logging oddity

Posted by Gwyn Evans <gw...@gmail.com>.
Ah, thanks...  I've added a page to that effect below the "Not Yet
Documented" page on the Wiki.

/Gwyn

On 13/11/2007, Jeff Butler <je...@gmail.com> wrote:
> This is related to a structural defect in the way iBATIS does logging.
> iBATIS does logging through dynamic proxies for all the JDBC objects - and
> these objects are only proxied if the Connection object itself is proxied.
> The Connection object is proxied only if debugging is enabled for it.  So,
> you'll not get any logging unless debugging is enabled for Connection.
>
> It wouldn't be too difficult to fix I suppose.
>
> Jeff Butler
>
>
> On Nov 13, 2007 11:23 AM, Gwyn Evans <gw...@gmail.com> wrote:
>
> > Hi - wonder if anyone can explain this...
> >
> > I'm testing with ibatis & am finding that if I have
> >
> > java.sql.Connection = Info
> > java.sql.PreparedStatement = Debug
> > java.sql.ResultSet = Debug
> >
> > then I don't get *any* ibatis logging, but if I change just the
> > java.sql.Connection value to Debug, then I get the following:
> >
> > 2007-11-13 17:17:57|
> |C-1|Connection|Debug|{conn-100000} Connection
> > 2007-11-13 17:17:57|
> |C-1|Connection|Debug|{conn-100000} Preparing
> > Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY ID ASC
> > LIMIT 1
> > 2007-11-13 17:17:57|
> |C-1|PreparedStatement|Debug|{pstm-100001}
> > Executing Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY
> > ID ASC LIMIT 1
> > 2007-11-13 17:17:57|
> |C-1|PreparedStatement|Debug|{pstm-100001} Parameters: []
> > 2007-11-13 17:17:57|
> |C-1|PreparedStatement|Debug|{pstm-100001} Types: []
> > 2007-11-13 17:17:57|   |C-1|ResultSet|Debug|{rset-100002}
> ResultSet
> >
> > If I leave Connection as debug & raise PreparedStatement to Info, then
> > I loose that as expected, but I can't get PreparedStatement without
> > Connection?
> >
> > (The settings are from Simple-log, which is where JCL is being adapted
> > to, so could be an issue with that, I guess...)
> >
> > /Gwyn
> >

Re: Logging oddity

Posted by Jeff Butler <je...@gmail.com>.
This is related to a structural defect in the way iBATIS does logging.
iBATIS does logging through dynamic proxies for all the JDBC objects - and
these objects are only proxied if the Connection object itself is proxied.
The Connection object is proxied only if debugging is enabled for it.  So,
you'll not get any logging unless debugging is enabled for Connection.

It wouldn't be too difficult to fix I suppose.

Jeff Butler

On Nov 13, 2007 11:23 AM, Gwyn Evans <gw...@gmail.com> wrote:

> Hi - wonder if anyone can explain this...
>
> I'm testing with ibatis & am finding that if I have
>
> java.sql.Connection = Info
> java.sql.PreparedStatement = Debug
> java.sql.ResultSet = Debug
>
> then I don't get *any* ibatis logging, but if I change just the
> java.sql.Connection value to Debug, then I get the following:
>
> 2007-11-13 17:17:57|   |C-1|Connection|Debug|{conn-100000} Connection
> 2007-11-13 17:17:57|   |C-1|Connection|Debug|{conn-100000} Preparing
> Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY ID ASC
> LIMIT 1
> 2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001}
> Executing Statement:  SELECT ID, DEST, SMSCA, T FROM SMSCAA ORDER BY
> ID ASC LIMIT 1
> 2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001}
> Parameters: []
> 2007-11-13 17:17:57|   |C-1|PreparedStatement|Debug|{pstm-100001} Types:
> []
> 2007-11-13 17:17:57|   |C-1|ResultSet|Debug|{rset-100002} ResultSet
>
> If I leave Connection as debug & raise PreparedStatement to Info, then
> I loose that as expected, but I can't get PreparedStatement without
> Connection?
>
> (The settings are from Simple-log, which is where JCL is being adapted
> to, so could be an issue with that, I guess...)
>
> /Gwyn
>