SpringBoot中Mybatis打印sql日志

application.yml中加上

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

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

上面二选一就可以了。

效果:

 

posted @ 2021-08-12 16:54  甜菜波波  阅读(3461)  评论(0编辑  收藏  举报