1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.logging.slf4j;
18
19 import org.apache.logging.log4j.spi.ThreadContextMap;
20 import org.slf4j.MDC;
21
22 import java.util.Map;
23
24
25
26
27 public class MDCContextMap implements ThreadContextMap {
28 public void put(final String key, final String value) {
29 MDC.put(key, value);
30 }
31
32 public String get(final String key) {
33 return MDC.get(key);
34 }
35
36 public void remove(final String key) {
37 MDC.remove(key);
38 }
39
40 public void clear() {
41 MDC.clear();
42 }
43
44 public boolean containsKey(final String key) {
45 return MDC.getCopyOfContextMap().containsKey(key);
46 }
47
48 public Map<String, String> getContext() {
49 return MDC.getCopyOfContextMap();
50 }
51
52 public Map<String, String> get() {
53 return MDC.getCopyOfContextMap();
54 }
55
56 public boolean isEmpty() {
57 return MDC.getCopyOfContextMap().isEmpty();
58 }
59 }