http://blog.csdn.net/deng11342/article/details/9122015
Http://www.blogjava.net/libin2722/archive/2007/12/04/165153.html
Print Ibatis Final SQL statement
At project development, everyone wants to print SQL in the background to help with the development and subsequent bug changes. If using JDBC so can be convenient to print, can use ibatis do not know how to do, recently on the Internet to find a section of log4j configuration can be very nanny to deal with this problem. Put it here for your reference.
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
Put this configuration in the Log4j.properties file.
In the project trial run need to maintain the stage can be debug to error, so that the server background only print error messages, so that both can see errors and reduce the burden on the server (the background is constantly printing data is consuming server resources. )
Ibatis Print full SQL statements in the background