mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-22 09:09:01 +00:00
Call LoggerContext.reset() during logback init
Update `LogbackLoggingSystem` to call the `reset()` method on the `LoggerContext` before initialization. This will hopefully reset the context to prevent the same appenders from being accidentally added more than once. Fixes gh-1091
This commit is contained in:
+1
@@ -96,6 +96,7 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem {
|
||||
+ "or the competing implementation (" + factory.getClass() + ")");
|
||||
LoggerContext context = (LoggerContext) factory;
|
||||
context.stop();
|
||||
context.reset();
|
||||
try {
|
||||
URL url = ResourceUtils.getURL(resolvedLocation);
|
||||
new ContextInitializer(context).configureByResource(url);
|
||||
|
||||
Reference in New Issue
Block a user