Does 'mybatis-3.0.4' version support printing executed SQL queries in the logs?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does 'mybatis-3.0.4' version support printing executed SQL queries in the logs?

asim mohd
I have a java project (guice (3.0) + mybatis(3.0.4)). Previously, I had mybatis-3.2.2 jar  and it printed SQL queries that executed in the logs. I downgraded mybatis jar to mybatis-3.0.4 and don't see executed queries being printed in the logs.

Sample logs that were printed while I had 3.2.2 version of mybatis:
---------------------------------------------------------------------------------------

2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ooo Using Connection [$Proxy24@xxxx] 
2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ==>  Preparing: SELECT PERSON_NAME FROM PERSON WHERE PERSON_ID = 1  
2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ==> Parameters:  
2016-10-07 12:28:00,183 DEBUG  [JdbcTransaction] Resetting autocommit to true on JDBC Connection 

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does 'mybatis-3.0.4' version support printing executed SQL queries in the logs?

Kazuki Shimizu
The MyBatis 3.0.4 has logging feature. However logger name is different with the MyBatis 3.2.2.
Probably, you should be defined logger for following classes , if you want to be output  jdbc logs (connection log, statement log and resultset log) .

* java.sql.Connection
* java.sql.PreparedStatement
* java.sql.Statement
* java.sql.ResultSet

e.g. ) log4j.properties

log4j.logger.java.sql=DEBUG


Please try it.
Thanks.

On Wednesday, October 19, 2016 at 6:48:21 AM UTC+9, asim mohd wrote:
I have a java project (guice (3.0) + mybatis(3.0.4)). Previously, I had mybatis-3.2.2 jar  and it printed SQL queries that executed in the logs. I downgraded mybatis jar to mybatis-3.0.4 and don't see executed queries being printed in the logs.

Sample logs that were printed while I had 3.2.2 version of mybatis:
---------------------------------------------------------------------------------------

2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ooo Using Connection [$Proxy24@xxxx] 
2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ==>  Preparing: SELECT PERSON_NAME FROM PERSON WHERE PERSON_ID = 1  
2016-10-07 12:28:00,183 DEBUG  [xxxxxxClients] ==> Parameters:  
2016-10-07 12:28:00,183 DEBUG  [JdbcTransaction] Resetting autocommit to true on JDBC Connection 

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...