适用地点:maven的mybatis的项目
配置log4j.properties
内容为
log4j.rootLogger=error, Console
log4j.logger.cn.bdqn.dao=debug
#Console
log4j.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
/*****************************************************/
同时maven库找到如下三个jar包
commons-logging
commons-logging
1.2
log4j
log4j
1.2.16
org.slf4j
slf4j-api
1.7.25
org.slf4j
slf4j-log4j12
1.7.25
test
将其复制到pom.xml
补充:mybatis打印SQL日志最终解决方案
问题