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
复制代码

上面二选一就可以了。

效果:

原文地址:https://www.cnblogs.com/tiancai/p/15133577.html