spring.boot.version: 3.1.12 logback.version:1.4.14 Issue: We are trying to update the logback config at runtime programatically using following code:

public class DynamicLogbackConfigurator {
  // Interface to fetch the updated logback xml
  private final S3Manager configManager;
  public void refresh() throws Exception {
    byte[] xml;
    val context = (LoggerContext) LoggerFactory.getILoggerFactory();
    val configurator = new JoranConfigurator();
    try (val logbackContent = configManager.getConfigStoreFile(ManagedFile.LOGBACK_CONFIG)) {
      xml = logbackContent.readAllBytes();
    } catch (final Exception e) {
      log.error("Failed to read logback configuration from config manager.", e);
      return;
    }
    try {
      configurator.setContext(context);
      context.reset();
      configurator.doConfigure(new ByteArrayInputStream(xml));
      log.info("Logback configuration has been refreshed from config manager.");
    } catch (final Exception e) {

      throw e;
    }
  }

Our logback config has spring property. On doing refresh, its not reading the spring property.

Comment From: mhalbritter

Hello,

Spring Boot 3.1.12 is no longer OSS supported. Please upgrade to an OSS supported version and see if the problem persists. If it does, please create a minimal reproducible sample.

Thanks!

Comment From: spring-projects-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-projects-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.

Comment From: sourav-jha

Checked for spring boot: 3.3.4 logback.version:1.5.8 found same issue. Probably issue is in code we are using JoranConfigurator. Instead we should use SpringBootJoranConfigurator. but SpringBootJoranConfigurator is not a public class

Comment From: mhalbritter

Thanks. Can you please provide a minimal sample for us to reproduce?

Comment From: sourav-jha

log_issue.zip sample application

Comment From: philwebb

I think the use of JoranConfigurator is indeed the problem, but I'm not convinced that we should make SpringBootJoranConfigurator public. Programmatically refreshing the logging system isn't something we've considered supporting.

Comment From: philwebb

We discussed this today at our team meeting and decided that we'd prefer to keep SpringBootJoranConfigurator package private. Programmatically refreshing the logging system isn't something we can prioritize at the moment.