springboot 配置mybatis打印sql

时间:2018-06-29 23:18:31   收藏:0   阅读:758

方式 一:

########################################################
###配置打印sql
########################################################
logging:
level:
com.threefivework.mymall.dao.mapper: DEBUG //包路径为mapper文件包路径

方式二:

在application.yml(.properties)中增加配置,在控制台打印sql:

mybatis
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 

参考类:org.apache.ibatis.session.Configuration
log-impl指定的值为org.apache.ibatis.logging.Log接口的某个实现类

原文:https://www.cnblogs.com/kingsonfu/p/9245731.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!