您的位置:首页 > 编程语言 > Java开发

springboot整合mybatis打印sql注意

2018-08-15 19:51 531 查看

这是网上百度得到的结果:

在application.properties配置文件中添加

[code]logging.level.com.xx.xx.dao=DEBUG

xx.xx.dao就是mapper那个方法接口的包

一开始测试无效

后面修改为在 log4j.properties中添加

[code]log4j.logger.com.xx.xx.dao=DEBUG有效,

后面想到项目排除了

[code]logging日志,使用的是slf4j日志,然后注释
[code]<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>

发现之前的配置可用

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: