mybatis-plus在控制台打印SQL语句的方法


方法一、在application.yml添加配置

mybatis-plus:
  configuration:
    #默认不显示SQL日志
#    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

方法二、 mapper增加日志等级为debug

logging:
 level:
  com.xxx.mapper: debug

mybaits相关配置

mybatis-plus:
  mapper-locations: classpath*:cn/demo/**/mapping/*.xml, classpath:/META-INF/modeler-mybatis-mappings/*.xml
  configuration:
    map-underscore-to-camel-case: true
    cache-enabled: true
    lazy-loading-enabled: true
    multiple-result-sets-enabled: true
    #默认不显示SQL日志
#    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    banner: false
    db-config:
      id-type: assign_id
      table-underline: true
    enable-sql-runner: true
  configuration-properties:
    prefix:
    blobType: BLOB
    boolValue: TRUE


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM