Mybatis打印SQL,MybatisLog插件不打印SQL。Property ‘configuration‘ 和‘configLocation‘ can`t specified together
1. Mybatis打印SQL,MybatisLog插件不打印SQL。
安装好了Mybatis的日志插件,但是发现完整的SQL日志并没有输出。
检查配置文件发现,少了配置。
mybatis.configuration.log-impl = org.apache.ibatis.logging.stdout.StdOutImpl
2. IllegalStateException: Property ‘configuration’ and ‘configLocation’ can not specified with together
但是,今天发现加上这个配置之后,项目启动居然报错了。
IllegalStateException: Property 'configuration' and 'configLocation' can not specified with together
好吧这是说这两个配置不能一起在properties配置文件里啊。那只能写道mybatis-config.xml里面了。这里面原本就有Log4j的啊。改成STDOUT_LOGGING
的。
<!-- <setting name="logImpl" value="LOG4J"/>-->
<setting name="logImpl" value="STDOUT_LOGGING"/><!-- 打印sql-->
本文来自博客园,作者:Huathy,遵循 CC 4.0 BY-NC-SA 版权协议。转载请注明原文链接:https://www.cnblogs.com/huathy/p/17253815.html