Only check for singleton in AutoConfigurationReportLoggingInitializer
Using containsBean() involves looking in the parent bean factory if there is one, and that would mean that the same report woykd be used for multiple contexts, which wouldn't make sense.
This commit is contained in:
@@ -59,7 +59,7 @@ public class AutoConfigurationReportLoggingInitializer implements
|
||||
public void initialize(ConfigurableApplicationContext applicationContext) {
|
||||
this.loggerBean = new AutoConfigurationReportLogger(applicationContext);
|
||||
ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
|
||||
if (!beanFactory.containsBean(LOGGER_BEAN)) {
|
||||
if (!beanFactory.containsSingleton(LOGGER_BEAN)) {
|
||||
beanFactory.registerSingleton(LOGGER_BEAN, this.loggerBean);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user