From bebcd60b7c81dc6069861de698fb42f32e6466ea Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 17 Sep 2014 18:00:41 -0700 Subject: [PATCH] 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 --- .../boot/logging/logback/LogbackLoggingSystem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java b/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java index cc6b18067f..39ba2dcf9d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java @@ -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);