Spring Boot ignoring logback-spring.xml

前端 未结 6 482
慢半拍i
慢半拍i 2021-02-05 16:31

I have 2 Spring Boot (1.4.1-RELEASE) console applications using Logback. Both configuration files are more or less identical, are located in my /src/main/resources

6条回答
  •  我在风中等你
    2021-02-05 17:07

    To use Logback, you need to include it and spring-jcl on the classpath. The simplest way to do that is through the starters, which all depend on spring-boot-starter-logging. For a web application, you need only spring-boot-starter-web, since it depends transitively on the logging starter. If you use Maven, the following dependency adds logging for you:

    
        org.springframework.boot
        spring-boot-starter-web
    
    

    So remove the logging dependency it is redundant.

提交回复
热议问题