I've got a Spring application (not Spring Boot) where I've integrated logback-extensions in order to programatically configure appenders. For example, the console appender is only configured for the "dev" profile (as per the logback-extensions wiki page using a DelegatingLogbackAppender).
This works great except the case where there is an error during context initialization. Then, Spring seems to destroy the delegated appender before the final error message gets logged! (e.g. "ERROR org.springframework.web.context.ContextLoader - Context initialization failed" followed by a stack trace).
Is there any way to work around this limitation and somehow delay the destruction of this appender?