How to print ibatis sql log on original REST API application ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015 04:43 AM
I use original rest-war in my web application, I want to print the SQL statement log when invoke rest api.
I can print it successufully on non rest API application, but I don't know how to config it for original rest API application.
Who know that how to config log4j.properties to print SQL statement for original REST API application ?
As we know, activiti use ibatis to do persistence, for REST API application, I tried to modify lots of times, it can not work.
My log4j.properties file like below:
log4j.rootLogger=debug, CA
When I debug in eclipse and change the value "org.slf4j.impl.JDK14LoggerAdapter.isDebugEnabled" = true manually, it will print ibatis sql log. How can i config it ?
Any feedback will be much appreciated. Thanks in advance.
Regards,
Frank
I can print it successufully on non rest API application, but I don't know how to config it for original rest API application.
Who know that how to config log4j.properties to print SQL statement for original REST API application ?
As we know, activiti use ibatis to do persistence, for REST API application, I tried to modify lots of times, it can not work.
My log4j.properties file like below:
log4j.rootLogger=debug, CA
# ConsoleAppenderlog4j.appender.CA=org.apache.log4j.ConsoleAppenderlog4j.appender.CA.layout=org.apache.log4j.PatternLayoutlog4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n#The following configuration which i look up on web site that support print ibatis log in non rest API activiti systemorg.activiti.engine.impl.persistence.entity=DEBUG org.activiti.engine.impl=DEBUGlog4j.logger.org.activiti.engine.impl=DEBUGlog4j.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.Connection=debug log4j.logger.java.sql.Statement=debug log4j.logger.java.sql.PreparedStatement=debug,stdout
When I debug in eclipse and change the value "org.slf4j.impl.JDK14LoggerAdapter.isDebugEnabled" = true manually, it will print ibatis sql log. How can i config it ?
Any feedback will be much appreciated. Thanks in advance.
Regards,
Frank
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2015 05:02 AM
We use
log4j.logger.org.apache.ibatis.level=DEBUG
(see https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/resources/log4j.pr...)
log4j.logger.org.apache.ibatis.level=DEBUG
(see https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/resources/log4j.pr...)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2016 11:25 AM
This does not work for me. I have log4j.properties in my test resources, but I can't see any SQL logs. Is there anything else we need to do?
