springboot整合mybatis-plus显示隐藏打印sql语句日志

 

整合参考: https://www.cnblogs.com/pxblog/p/14445162.html

 

显示

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

 

不显示

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

 

如果没有,就指定下级别

# 日志配置
logging:
  level:
    com.test: debug
    org.springframework: warn

 

com.test是类所在的包名

 

 

 

 

 

复制代码
mybatis-plus:
  #扫描mapper文件所在位置
  mapper-locations: classpath*:mapper/**/*Mapper.xml
  #可以指定实体类所在包路径
  typeAliasesPackage: com.ruoyi.**.domain
  global-config:
    banner: false
    db-config:
      # 主键类型 0:数据库ID自增 1.未定义 2.用户输入 3 id_worker 4.uuid 5.id_worker字符串表示
      id-type: AUTO
      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
      field-strategy: NOT_NULL
      # 默认数据库表下划线命名
      table-underline: true
  config-location: classpath:mybatis/mybatis-config.xml
#  configuration:
#    map-underscore-to-camel-case: false
#    cache-enabled: true #配置的缓存的全局开关
#    lazyLoadingEnabled: true #延时加载的开关
#    multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
复制代码

 

posted @   yvioo  阅读(1352)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示