Apply correct ordering in logging system on startup

Completes the work started in 7f687b1, where the call to
LoggingSystem.beforeInitialization() was ommitted which results
in JUL logging never being available in the application.

Partial fix for #131 (but a /refresh is still broken)
This commit is contained in:
Dave Syer
2016-09-16 12:11:15 +01:00
parent 30a7bb9a70
commit 68c7fcf7d8

View File

@@ -85,11 +85,18 @@ public class BootstrapApplicationListener
ConfigurableApplicationContext context = bootstrapServiceContext(environment,
event.getSpringApplication());
apply(context, event.getSpringApplication(), environment);
shutdownLogging();
}
private void shutdownLogging() {
// Clean up the logging system. Logging will go dark until the
// ConfigFileApplicationListener fires, but this is the price we pay for that
// listener being able to adjust the log levels according to what it finds in its
// own configuration.
LoggingSystem.get(ClassUtils.getDefaultClassLoader()).cleanUp();
LoggingSystem loggingSystem = LoggingSystem
.get(ClassUtils.getDefaultClassLoader());
loggingSystem.cleanUp();
loggingSystem.beforeInitialize();
}
private ConfigurableApplicationContext bootstrapServiceContext(