方式一: 指定mybatis日志级别
# application.yml mybatis: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 等价于application.properties mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
方式二:配置mybatis-config.xml
<configuration> <settings> <setting name="logImpl" value="STDOUT_LOGGING"/> </settings> </configuration>
方式三:指定整个mapper包下的日志级别
# application.yml logging: level: com.example.demo.mapper: debug # 等价于application.properties logging.level.com.example.demo.mapper=debug
参考