美文网首页
SpringBoot 中的 Mybatis 打印 执行过的SQL

SpringBoot 中的 Mybatis 打印 执行过的SQL

作者: 张云飞Vir | 来源:发表于2020-11-13 17:42 被阅读0次

1.背景

在SpringBoot 中使用基于 Mybatis 框架,开发过程中,想看 Mybatis 生成的 sql语句 情况,做下配置即可。

2.打印 执行过的 SQL 语句

非常简单,如果使用的是application.yml文件,加入如下配置:

logging:
  level:
     com.example.demo.dao : debug</pre>

注意上面的 com.example.demo.dao 是个包名,指向你的mapper的包即可。

相关文章

网友评论

      本文标题:SpringBoot 中的 Mybatis 打印 执行过的SQL

      本文链接:https://www.haomeiwen.com/subject/hakbbktx.html