spring MVC mybatis 日志问题
springmvcmybatis日志一直打印不出来,看了mybatis日志加载原理,今天终于搞定。
log4j.properties日志文件
###setloglevels###
log4j.rootLogger=INFO,C,D,E
###console###
log4j.appender.C=org.apache.log4j.ConsoleAppender
log4j.appender.C.Target=System.out
log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern=[项目][%p][%-d{yyyy-MM-ddHH:mm:ss}]%C.%M(%L)|%m%n
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
必不可少的log4j.jar到这能打印出日志但是打印不出sql语句
最重要的是必须把下面的jar包加上slf4j-log4j12.jar,slf4j-api.jar
这个时候运行程序sql语句就能打印出来了!
相关推荐
MrLiar 2020-07-07
chw0 2020-11-04
大唐帝国前营 2020-08-18
sdaq 2020-07-26
sdaq 2020-06-16
CXC0 2020-06-14
丨Fanny丨Cri 2020-06-13
CXC0 2020-06-08
dongxurr 2020-06-07
sdaq 2020-06-06
MrLiar 2020-06-04
丨Fanny丨Cri 2020-06-03
MrLiar 2020-05-25
丨Fanny丨Cri 2020-05-17
MrLiar 2020-05-14
MrLiar 2020-05-12
sdaq 2020-05-11