SpringBoot 在日志中显示sql

JPA Hebernate项目中需要输出sql语句,可以用如下方式

spring:
  jpa:
    show-sql: true

mybatis中可以使用如下方式

logging:
  config: classpath:logging-config.xml
  level:
    com.yd.boxtest.dao: debug #dao所在的包文件
    org.springframework.jdbc.core: error
    root: info
    org.hibernate: ERROR
debug: false

logging-config.xml文件如下

https://gitee.com/JDD0570/logging-config

你可能感兴趣的:(SpringBoot 在日志中显示sql)