SpringBoot开发环境下开启mybatis日志控制台SQL打印

原先的配置如下:

mybatis:
  type-aliases-package: com.newmall.pojo # 所有POJO类所在包路径
  mapper-locations: classpath:mapper/*.xml # mapper映射文件

为了测试方便需要开启mybatis日志sql打印,只需要加 configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl配置即可在控制台中看到执行的sql。

mybatis:
  type-aliases-package: com.newmall.pojo # 所有POJO类所在包路径
  mapper-locations: classpath:mapper/*.xml # mapper映射文件
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

猜你喜欢

转载自blog.csdn.net/qq_34871626/article/details/107300371