Commit 06c16ae4 authored by Dave Syer's avatar Dave Syer

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.
parent faf02a21
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment