AnsweredAssumed Answered

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

Question asked by youtianhong on Jul 16, 2015
Latest reply on Sep 23, 2016 by snigdha.girdhar
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

# ConsoleAppender
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.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 system
org.activiti.engine.impl.persistence.entity=DEBUG
org.activiti.engine.impl=DEBUG
log4j.logger.org.activiti.engine.impl=DEBUG

log4j.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

Outcomes