-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Logback autoreload feature (scan=true) not compatible with springProfile and springProperty #5611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the detailed analysis! Unfortunately I don't use It looks like it's going to be very tricky to hook into I'm afraid for now, we'll probably need to leave this as a known limitation :( |
One can workaround the problem with Conditional processing using the Janino library: <if condition='property("spring.profiles.active").contains("development")'>
<then>
<include resource="org/springframework/boot/logging/logback/base.xml" />
</then>
<else>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
… |
Hello, I'm facing the same issue while using Logback scan=true with springProperty. Can someone provide an update on whether this has been resolved or if there's a workaround available now? Thank you ! |
This remains a known and documented limitation. Unfortunately, there are no known workarounds beyond the suggestion above. |
Spring Boot 1.3.2.RELEASE
During initialization of Logback SpringBoot uses its own class SpringBootJoranConfigurator (that extends JoranConfigurator) to suppoer configuration feature.
And then it uses it like this:
At the same time Logback (when running with scan=true option) uses turbofilter ReconfigureOnChangeFilter to monitor for logback.xml file changes and when that change happens run this code to reconfigure itself:
and at that moment JoranConfigurator simply doesnt know how to process springProperty::
This all makes springProperties unusable when running with logback autoreload feature enabled (scan=true)... Do you have any plans or thought on this issue?
The text was updated successfully, but these errors were encountered: