Closed awdm closed 5 days ago
I don't think it's broken. The thresholds are applied using a filter that's added to the console appender or file appender. For a log event to reach that filter, the configured log level has to have allowed it to do so. In other words, if you want a threshold of debug to have an effect, you have to have enabled some debug-level logging. If you run your application with logging.level.com.example.demo=debug
, you should see the DemoApplication
's debug logging being output.
You'd typically use the thresholds by configuring different values for logging.threshold.file
and logging.threshold.console
where you want the logging in one to be more or less verbose than the logging in the other.
Yes, that works. I wasn't aware that there's a second setting that you have to adjust. Thanks for the help.
I've tested this with a fresh Spring Boot 3.3.3 application from https://start.spring.io/ (Java 17, Maven, no dependencies).
I changed
DemoApplication.java
to:In
application.properties
I added:When I start the application, the warning and info messages are printed to both the console and the file, but the debug message is not. When I change the threshold properties to
warn
, only the warning messages are printed, which leads me to believe that the property is broken.