Spring Boot ignoring logback-spring.xml

前端 未结 6 493
慢半拍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条回答
  •  -上瘾入骨i
    2021-02-05 17:08

    I faced the same issue and tried finding if any of logback.xml or logback-grrovy.xml etc. already in claspath, but was not able to find any

    Then I tried some changes:

    1. Changed name from logback.xml to logback-spring.xml

    2. Removed following dependency from pom.xml Instead of

          
              org.springframework.boot
              spring-boot-starter
              
                  
                      org.springframework.boot
                      spring-boot-starter-logging
                  
              
          
          
              org.slf4j
              slf4j-api
              1.7.13
          
      

    I tried this

            
                org.springframework.boot
                spring-boot-starter
            
            
                org.slf4j
                jcl-over-slf4j
            
    

提交回复
热议问题