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

阅读 47

2022-04-08

原先的配置如下:

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

精彩评论(0)

0 0 举报