test

博客园 首页 新随笔 联系 订阅 管理

方式 一:

########################################################
###配置打印sql
########################################################
logging:
    level:
      com.threefivework.mymall.dao.mapper: DEBUG //包路径为mapper文件包路径


方式二:

在application.yml(.properties)中增加配置,在控制台打印sql:

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

 

参考类:org.apache.ibatis.session.Configuration
log-impl指定的值为org.apache.ibatis.logging.Log接口的某个实现类

 

mybatis-config.xml添加配置

<setting name="logImpl" value="org.apache.ibatis.logging.stdout.StdOutImpl"/>

 

posted on 2023-06-30 10:20  testgogogo  阅读(726)  评论(0编辑  收藏  举报