KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > slf4j > impl > Log4jMDCAdapter


1 package org.slf4j.impl;
2
3 import java.util.Map JavaDoc;
4
5 import org.slf4j.spi.MDCAdapter;
6
7 public class Log4jMDCAdapter implements MDCAdapter {
8
9   public void clear() {
10     Map JavaDoc map = org.apache.log4j.MDC.getContext();
11     if(map != null) {
12       map.clear();
13     }
14   }
15
16   public String JavaDoc get(String JavaDoc key) {
17     return (String JavaDoc) org.apache.log4j.MDC.get(key);
18   }
19
20   public void put(String JavaDoc key, String JavaDoc val) {
21     org.apache.log4j.MDC.put(key, val);
22   }
23
24   public void remove(String JavaDoc key) {
25     org.apache.log4j.MDC.remove(key);
26   }
27
28 }
29
Popular Tags