You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Log4j2EventListener's @ConditionalOnProperty has no effect - the listener always runs #4244
Log4j2EventListener carries @ConditionalOnProperty("spring.cloud.config.watch.enabled") but always runs.
It is registered twice:
as @Component — the condition applies
in META-INF/spring.factories (line 17) as an ApplicationListener — the condition cannot apply, because SpringApplication instantiates these directly, with no bean definition to suppress
So spring.cloud.config.watch.enabled=false disables nothing.
Version: 2.x 04c93c1d33 · JDK 21 · Spring Boot 3.4.3
Logs
Property set to false, monitorInterval 300s:
RELOADED - the refresh event drove the reload, 298 seconds before
the monitorInterval would have
298s ahead of the interval, so the event drove it, not the timer.
Reproduction
Run with -Dspring.cloud.config.watch.enabled=false and publish an EnvironmentChangeEvent (POST /actuator/refresh). Log4j reconfigures anyway.
Suggested fix
Check the property inside onApplicationEvent against the Environment — smallest change, keeps the documented switch meaningful. Or drop @ConditionalOnProperty so the source stops promising a switch that does not exist.
Activity
AzazelSensei commentedon Aug 15, 2026
Opened #4252 so spring.cloud.config.watch.enabled=false is honored when the listener comes from spring.factories.
Honor spring.cloud.config.watch.enabled on Log4j2EventListener (apach…