方法1
在springboot+mybatis整合中,可以将springboot的配置文件添加如下一段也可:
logging: level: com.lucifer.springboot.cache.mapper: debug
ps: com.lucifer.springboot.cache.mapper是包名
方法2
- (spring+mybatis)在mybatis的配置文件中添加:
<settings> <setting name="logImpl" value="STDOUT_LOGGING" />settings>
示例:mybatis的配置文件----mybatis-config.xml如下:
DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration> <settings> <setting name="logImpl" value="STDOUT_LOGGING" /> settings>configuration>
- (springboot+mybatis)在springboot的配置文件----appcation.yml中添加:
mybatis: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
方法三
如果你使用的是springboot+mybatis-plus的话:
<dependency> <groupId>com.baomidougroupId> <artifactId>mybatis-plus-boot-starterartifactId> <version>3.3.1version> dependency>
application.yml:
mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
来源地址:https://blog.csdn.net/qq_43985303/article/details/130004299