spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

PropertySourceBootstrapConfiguration.reinitializeLoggingSystem can't log the exception

Open githubyong opened this issue 4 years ago • 1 comments

PropertySourceBootstrapConfiguration.reinitializeLoggingSystem can't log the exception PropertySourceBootstrapConfiguration.logger.warn("Error opening logging config file " + logConfig, ex); it won't work

environment: spring-cloud-context 3.1.0

cause: system.initialize(new LoggingInitializationContext(environment), logConfig, logFile); this line will call org.springframework.boot.logging.logback.LogbackLoggingSystem#stopAndReset and cleard the ROOT logger's appender list. so the PropertySourceBootstrapConfiguration.logger.warn won't work.

githubyong avatar Feb 08 '22 14:02 githubyong

I can confirm this. We've migrated a project to spring-cloud-context 3.0.3 and no longer see any warning or error message if the log config file is missing. I suppose it is related to the change in https://github.com/spring-cloud/spring-cloud-commons/commit/4a2e83ea461e2ba88ecd27b2c00f2eda1bef43e7

ch-k avatar May 10 '22 06:05 ch-k