I can't find any existing article/documentation related to this. The spring cloud config server and logback XML configuration are working in harmony, whenever I change something in my git repo config and trigger refresh of my application, somehow the logback automatically gets updated even though the logback is not in the config server but in the jar file itself.

Basically, my configuration is something like this:

I have an SMTP appender in my logback XML, at startup I'm checking if the enableSMTP is enabled, then I only set the recipient.

<if condition='property("smtpEnabled").equals("true")'>
    <then>
        <to>to@to.com</to>
    </then>
</if>

This is to prevent email sending if the property is disabled, then I'm setting it back programmatically, ideally in EnvironmentChangeEvent. However, changing the property in the config server and calling the /monitor endpoint from the spring cloud config server automatically sets this value in logback without programmatically setting it through the event handler.

Is this behavior of environment change and auto reconfigure of logback expected? (note that logback scan is disabled)

Comment From: ryanjbaxter

So is the event handler not called? Logging is reinitialized when a refresh event is received.

Comment From: fuzzy28

@ryanjbaxter The event handler is invoked, initially my implementation was using this to listen for the property change and then I reconfigure the logback appended property programmatically. To my surprise, I don't need to do it anymore since logging is indeed reinitialized after the invocation of /refresh from the spring cloud server. But still, I don't see any related discussion about this, was this discussed somewhere in the docs?

Comment From: ryanjbaxter

Are you upgrading from a previous version of Spring Cloud that caused a change in behavior?

Comment From: fuzzy28

@ryanjbaxter no I am not, we are using Finchley.RELEASE from the beginning, I just don't know that this feature exists.

Comment From: ryanjbaxter

To my surprise, I don't need to do it anymore

So you are saying this is a chance in behavior from Finchley.RELEASE?

What release are you trying now?

Comment From: fuzzy28

@ryanjbaxter I'm not exploring any other release version if I understand you correctly.

So you are saying this is a chance in behavior from Finchley.RELEASE?

Yes, is this really expected? any documentation can I refer to this behavior?

Comment From: ryanjbaxter

I am really lost on how the behavior changed if you did not change the Spring Cloud version. Maybe I am not understanding you. I can't point you to any kind of documentation because I am not understanding how the behavior could change.

Comment From: fuzzy28

@ryanjbaxter sorry for my mistake, what I mean is, I've been using Finchley.RELEASE spring cloud version from the start of the project, I didn't try any other release version aside from this.

From the beginning, I didn't know that when you call /refresh will also refresh the logback cause I haven't seen this in any article or documentation. If this is expected behavior, then could you please refer me to the documentation or the code to where this reload of logback is located.

Comment From: ryanjbaxter

Refresh events will restart the application context so logging will be reinitialized I believe

Comment From: fuzzy28

@ryanjbaxter any document related to this that you may share?

Comment From: ryanjbaxter

I think the most relevant documentation might be here https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#environment-changes

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.