I have a Spring Boot (v2.7.0) application running in production for quite some time. There was a problem reported recently and for which I needed a bit more logs, and decided to change the logging configuration from INFO to DEBUG. After restarting the application the debug logs were still absent from the log file. Debuging this localy to noticed that the logging level in the application-{profile}.yml is only taken into consideration only when running trough InteliJ. I'm using lombok SLF4J annotation for logging and no logback.xml configuration override is presented.
application-dev.yml
logging:
level:
root: warn
./gradlew :app:bootRun --args='--spring.profiles.active=dev'
./gradlew :app:bootRun --args='--spring.profiles.active=dev'
> Task :app:bootRun
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.0)
[main] INFO com.package.app.Application - Starting Application using Java 1.8.0_392 on d with PID 34257 (/home/d/workspace/yolo/om/app/build/classes/java/main started by d in /home/d/workspace/yolo/om/app)
[main] INFO com.package.app.Application - The following 1 profile is active: "dev"
[background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.3.Final
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 22 ms. Found 2 JPA repository interfaces.
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 4 ms. Found 2 JPA repository interfaces.
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
[main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 7 ms. Found 3 JPA repository interfaces.
[main] INFO org.springframework.boot.wSessioneb.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
Tried running bootJar and starting with java -jar and passing logging overrides, tried to gradle bootRun and noticed that the configured level is still ignored and INFO is used.