异常SLF4JLoggerContext cannot be cast to log4j.core.LoggerContext

问题:
SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext

有log包冲突,需要处理冲突的包
方式1.排除以下包【如果有】

log4j-to-slf4j-2.0.2.jar
log4j-to-slf4j-2.0.2-sources.jar
log4j-slf4j-impl-2.0.2.jar
log4j-slf4j-impl-2.0.2-sources.jar

方式2.排除spring-boot-starter下的log4j-to-slf4j包
直接引入logging排除对应包

 
 org.springframework.boot
 spring-boot-starter-logging
 
 
 org.apache.logging.log4j
 log4j-to-slf4j
 
 
 

你可能感兴趣的:(javaspring后端)