Historically some classes have cached the logger level in static fields to prevent calls to the logging framework to reolve logging levels at run time.
Caching the log level at build time can cause a race condition in log levels at runtime, especially when the build system is multi-tiered. This is evident in a Quarkus native binary, as an incorrect log level at runtime;
Optimisations in logging frameworks now mean that there is not a performance penalty for checking log level defined in the logging framework, removing the need to cache the log level.
I have verified that reverting the log level caching does not degrade performance in 2 of our benchmarks;
Quarkus JVM - Hibernate 5.4.2.Final
Quarkus JVM - Hibernate 5.4.2 + patch
Quarkus Native - Hibernate 5.4.2.Final
Quarkus Native - Hibernate 5.4.2 + patch
Request Mean Latency (s)
JVM - Hibernate 5.4.2.Final
JVM - Hibernate 5.4.2 + patch