-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed
Description
This was found using Spring Boot 3.2.4 and Java 21. Seems related to #36741.
Steps to reproduce
- Build jar for any Spring Boot app that is using the default logging setup - i.e. spring-boot-starter-logging with no logback.xml or other config files, just
logging.*
properties set in application.yml. - Set
logging.threshold.console
to "off" in application.yml or application-{profile}.yml:
logging:
threshold:
console: off
- Run app:
java -jar path/to/app.jar
Expected result
Only Spring banner printed to console, all logging goes to log file (if configured).
Actual result
All logging appears on console.
Observations
Running the app with this command instead produces expected result, with or without the same set in application.yml:
java -Dlogging.threshold.console=off -jar path/to/app.jar
Not sure if this could be relevant, but I noticed that the start()
method is called directly on the ThresholdFilter
, rather than using config.start(filter)
:
https://github.com/spring-projects/spring-boot/blob/v3.2.4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java#L108
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement