刚开始,logback-classic和logback-core依赖是1.1.x版本,报上述错误
而spring-boot-starter-webyy依赖版本是2.2.1.RELEASE,应该是二者版本不一致导致
将logback版本改为1.2.3后解决
<!-- 日志 包含slf4j接口和log4j实现 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>