diff --git a/logging-modules/logback/src/main/java/com/baeldung/logback/MapAppender.java b/logging-modules/logback/src/main/java/com/baeldung/logback/MapAppender.java index 99cc6488e5..a25c54b96e 100644 --- a/logging-modules/logback/src/main/java/com/baeldung/logback/MapAppender.java +++ b/logging-modules/logback/src/main/java/com/baeldung/logback/MapAppender.java @@ -3,12 +3,14 @@ package com.baeldung.logback; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; public class MapAppender extends AppenderBase { - private final Map eventMap = new HashMap<>(); + private final ConcurrentMap eventMap + = new ConcurrentHashMap<>(); private String prefix;