To meet this need when doing projects. We want to eventually print out the SQL statements that run in the database, and these are common issues that are commonly encountered. I will go to appfuse, and the result is not successful this time. It has a related configuration, but it doesn't seem to be practical. And I didn't go deep. I think this kind of question must have been met on the Internet. Just to find this person. After changing the different keyword. I finally found a configuration such as the following.
Log4j.appender.stdout=org.apache.log4j.consoleappender
Log4j.appender.stdout.layout=org.apache.log4j.patternlayout
log4j.appender.stdout.layout.conversionpattern=%d%p [%c]-%m%n
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
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
Print Ibatis Finally, the SQL declaration