Skip to content

Commit bebcd60

Browse files
committed
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
1 parent 6dcaec2 commit bebcd60

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void initialize(String configLocation) {
9696
+ "or the competing implementation (" + factory.getClass() + ")");
9797
LoggerContext context = (LoggerContext) factory;
9898
context.stop();
99+
context.reset();
99100
try {
100101
URL url = ResourceUtils.getURL(resolvedLocation);
101102
new ContextInitializer(context).configureByResource(url);

0 commit comments

Comments
 (0)