日志打印mybatis中SQL

log4j.rootLogger = DEBUG,stdout,D

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Threshold = DEBUG
log4j.appender.stdout.layout=com.tuniu.gt.common.ExPatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %p  %c\:%L - %m%n

log4j.logger.com.springframework=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  
log4j.logger.java.sql.ResultSet=DEBUG

#log4j.logger.org.mybatis=INFO
#log4j.logger.java.sql=INFO
#log4j.logger.java.sql.ResultSet=INFO  
#log4j.logger.org.apache=INFO  
#log4j.logger.java.sql.Connection=INFO  
#log4j.logger.java.sql.Statement=INFO  
#log4j.logger.java.sql.PreparedStatement=INFO 

 


log4j.appender.D = org.apache.log4j.FileAppender
log4j.appender.D.File = /opt/tuniu/logs/tomcat/app/${tomcat_app_base}/common.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = DEBUG 
log4j.appender.D.layout = com.tuniu.gt.common.ExPatternLayout
log4j.appender.D.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %p  %c\:%L - %m%n

你可能感兴趣的:(Java)