Closed
Description
Is it right way to cleanUp loggingSystem after nested context was destroyed?
I have next code:
migrationContext = new AnnotationConfigApplicationContext();
migrationContext.setParent(applicationContext);
.../*(some actions in migrationContext */
migrationContext.destroy(); // sends ContextClosedEvent to LoggingApplicationListener `
After that I can't get log messages from JUL.
What I'm doing wrong? Is it bug in LoggingApplicationListener or I use wrong way to create nested context?
As workaround - do not send ContextClosedEvent by nested context:
migrationContext = new AnnotationConfigApplicationContext()
{
@Override
public void publishEvent(ApplicationEvent event)
{
if (!(event instanceof ContextClosedEvent))
{
super.publishEvent(event);
}
}
};