I have a sample Spring Boot application that uses Logback for logging.
So I have logback-spring.xml
next to the jar to configure the logging, however it does not work unless I specify it with logging.config
, ex : logging.config=logback-spring.xml
.
I have looked into Spring Boot ignoring logback-spring.xml where it suggests that it might be because there's already a spring.xml
somewhere, but putting breakpoint on org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(LoggingInitializationContext, LogFile)
shows that logFile is empty.
Am I doing something wrong here ?
logback-spring.xml
in root of your project. Do a 'bootJar' build, and execute the JAR. Does it work ? – Zielsdorf