SpringBoot + MyBatisSQL输出配置
指定MyBatis的日志实现为Slf4J
application.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.Slf4jImpl
log-impl属性种指定了Slf4j的日志实现
配置Mapper包输出级别为DEBUG
application.yml文件logging: level: root: INFO com.exmple.mapper: DEBUG file: "D:/demo.log" # config: classpath:logback-spring.xml
root或mapper包指定为DEBUG
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)
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01