idea 如何开启mybatis控制台SQL日志打印

开启

application.yaml

mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

mybatis:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true
  typeAliasesPackage: XXXX
  mapper-locations: classpath*:**/xml/*Mapper.xml

application.properties

mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

关闭

application.yaml

mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl

application.properties

mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl

StdOutImpl 只是 mybatis 的一种日志实现, mybatis还有多种日志实现

如何知道现在使用的哪种方式?
在项目启动时,会在控制台直接打印如下提示:

Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.

参考

mybatis-plus 开启与关闭 SQL 日志打印
使用springboot默认的日志系统logback打印Mybatis语句问题

相关推荐

  1. idea 如何开启mybatis控制台SQL日志打印

    2023-12-30 03:54:02       44 阅读
  2. MyBatis实战:如何将拼接的SQL打印到日志

    2023-12-30 03:54:02       17 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-30 03:54:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-30 03:54:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-30 03:54:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-30 03:54:02       18 阅读

热门阅读

  1. C++ 多态详解(14)

    2023-12-30 03:54:02       48 阅读
  2. Bun 安装

    2023-12-30 03:54:02       53 阅读
  3. 鸿蒙Harmony(十)动画

    2023-12-30 03:54:02       33 阅读
  4. 编程笔记 html5&css&js 002 一些基本概念

    2023-12-30 03:54:02       30 阅读
  5. 送你一台云电脑

    2023-12-30 03:54:02       36 阅读
  6. 系列十一、解压文件到指定目录

    2023-12-30 03:54:02       25 阅读
  7. 面向对象进阶-继承

    2023-12-30 03:54:02       36 阅读
  8. Linux模块编译

    2023-12-30 03:54:02       44 阅读
  9. C++三剑客之std::variant(一)

    2023-12-30 03:54:02       35 阅读
  10. install mpirun

    2023-12-30 03:54:02       47 阅读