项目使用spring mvc+ mybatis + maven 发现log4j.properties中已经开启了debug,仍然不能show sql,搜了很久没有结果,最终到stackoverflow上面找到了答案。见这里
由于项目中配置了多个日志,slf4j、log4j需要加上slf4j-log4j12包,pom.xml配置如下
<
dependency
>
<
groupId
>org.slf4j</
groupId
>
<
artifactId
>slf4j-log4j12</
artifactId
>
<
version
>1.7.5</
version
>
</
dependency
>
|
本文介绍了解决SpringMVC+MyBatis项目中无法显示SQL的问题。通过配置slf4j-log4j12依赖,使得log4j能够正常记录MyBatis执行的SQL语句。

被折叠的 条评论
为什么被折叠?



