mybatis 列印sql語句配置
阿新 • • 發佈:2019-02-09
在classpath路徑下配置log4j.properties如下:
log4j.rootLogger=DEBUG,Console
#Consolelog4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
log4j.logger.org.apache=INFO
log4j.logger.com.ibatis = ERROR
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource = ERROR
log4j.logger.com.ibatis.common.jdbc.ScriptRunner = ERROR
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate = ERROR
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG