SpringBoot Mybatis和Mybatis plus 打印sql

mybatis plus

方式一

  在logback-spring.xml中添加

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
    <logger name="com.service.policy.mapper" level="DEBUG"/>
</configuration>

方式二

  在application.properties添加

#mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

Mybatis

方式一

  在application.properties中添加

#开启控制台打印sql
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

 

posted @ 2020-11-19 17:28  陈彦斌  阅读(3745)  评论(0)    收藏  举报