小工具知识网

当前位置: 首页 > 行业知识 > Springboot项目中Mybatis输出SQL日志的三种方式

行业知识

Springboot项目中Mybatis输出SQL日志的三种方式

2026-11-11 12:30:43 来源:互联网转载

方法一:指定整个mapper包下的日志级别

# application.ymllogging:  level:    com.fwzx.dao: debug  #对应到mapper中dao包的路径 # 等价于application.propertieslogging.level.com.example.demo.mapper=debug

方法二:指定mybatis日志级别

# application.ymlmybatis:  configuration:    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 等价于application.propertiesmybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

方法三:配置mybatis-config.xml

                

上一篇:揭秘图片裁剪源码,轻松掌握高效图片处理秘籍!

下一篇:怀旧服服务器阵营怎么搭配?