SpringBoot+Mybatis打印SQL的最简单方法

如题,需要SpringBoot+Mybatis的架构中打印SQL,最简单快捷的方法就是在springboot的配置文件中加入如下配置

logging:
  level:
    com.simons.cn.springbootdemo.dao.system:
      debug

因为我的配置文件是yml格式的,如果你的是.properties,直接加

logging.level.com.simons.cn.springbootdemo.dao.system=debug
com.simons.cn.springbootdemo.dao.system下放着所有mybatis的mapper接口文件,debug代表日志等级。

猜你喜欢

转载自blog.csdn.net/fanrenxiang/article/details/80916533