问题是这样的,排除springboot 默认的logback 改成 使用slf4j 的时候,出现了报错,请教下是否@SpringBootApplication 注解上也需要排除
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
@Slf4j
@RestController
public class LogController {
@GetMapping("/")
public void test(){
log.info("hello world");
}
}