指定MyBatis的日志实现为Slf4Japplication.yml文件mybatis: type-aliases-package: com.contract.housekeeper.dao.entity mapper-locations: classpath*:com/contract/housekeeper/dao/mapping/*.xml configuration: log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpllog-impl属性种指定了Slf4j的日志实现配置Mapper包输出级别为DEBUGapplication.yml文件logging: level: root: INFO com.exmple.mapper: DEBUG file: “D:/demo.log”# config: classpath:logback-spring.xmlroot或mapper包指定为DEBUGTips:MyBatis的logImpl可选值有:Log4j2LoggerImpl (org.apache.ibatis.logging.log4j2)StdOutImpl (org.apache.ibatis.logging.stdout)Jdk14LoggingImpl (org.apache.ibatis.logging.jdk14)Slf4jImpl (org.apache.ibatis.logging.slf4j)Slf4jLocationAwareLoggerImpl (org.apache.ibatis.logging.slf4j)NoLoggingImpl (org.apache.ibatis.logging.nologging)Slf4jLoggerImpl (org.apache.ibatis.logging.slf4j)JakartaCommonsLoggingImpl (org.apache.ibatis.logging.commons)Log4jImpl (org.apache.ibatis.logging.log4j)Log4j2Impl (org.apache.ibatis.logging.log4j2)Log4j2AbstractLoggerImpl (org.apache.ibatis.logging.log4j2)