Mybatis log4j

Fairy-KunKun 2022-05-14 14:37:45 阅读数:168

mybatislog4jlog

jar package

<dependency>     <groupId>log4j</groupId>     <artifactId>log4j</artifactId>     <version>1.2.17</version>     <type>bundle</type> </dependency>

log4j.properties

log4j.rootLogger=DEBUG,Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender 
log4j.appender.Console.Target=System.out 
log4j.appender.Console.layout = org.apache.log4j.PatternLayout 
log4j.appender.Console.layout.ConversionPattern=%d{yyyy-MM-dd-HH\:mm\:ss,SSS} [%t]  [%c] [%p] - %m%n
### Show SQL Statement part
log4j.logger.com.mybatis=DEBUG 
log4j.logger.com.mybatis.common.jdbc.SimpleDataSource=DEBUG 
log4j.logger.com.mybatis.common.jdbc.ScriptRunner=DEBUG 
log4j.logger.com.mybatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG 
log4j.logger.java.sql.Connection=DEBUG 
log4j.logger.java.sql.Statement=DEBUG 
log4j.logger.java.sql.PreparedStatement=DEBUG

summary : stay maven It's equipped with , Just get a configuration file . 

版权声明:本文为[Fairy-KunKun]所创,转载请带上原文链接,感谢。 https://javamana.com/2022/134/202205141429154416.html