首页 > 技术文章 > SpringBoot中Mybatis打印sql日志

cat520 2020-05-15 21:31 原文

application.yml中加上

# springBoot+Mybatis 控制台打印SQL语句  (方式一)
logging:
  level:
    com.zoctan.api.mapper : debug

# 配置slq打印日志 (方式二)
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

上面二选一就可以了。

效果:

 

推荐阅读