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-->
posted @ 2022-07-06 14:27  Huathy  阅读(61)  评论(0编辑  收藏  举报  来源