MyBatis 配置控制台上显示sql语句(log4j.properties 之三)

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L

  • %m%n

### set log levels – for more verbose logging change ‘info’ to
‘debug’ ###

log4j.rootLogger=debug, stdout

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

不必任何操作,直接复制替换即可!

网站地图xml地图