当前位置: 代码迷 >> 综合 >> SpringBoot开发环境下开启mybatis日志控制台SQL打印
  详细解决方案

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

热度:94   发布时间:2023-10-17 09:42:27.0

原先的配置如下:

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

 

  相关解决方案