SLF4J LOG4J-12 Binding 1.6.1-redhat-1

org.slf4j.impl
Class Log4jMDCAdapter

java.lang.Object
  extended by org.slf4j.impl.Log4jMDCAdapter
All Implemented Interfaces:
MDCAdapter

public class Log4jMDCAdapter
extends Object
implements MDCAdapter


Constructor Summary
Log4jMDCAdapter()
           
 
Method Summary
 void clear()
           
 String get(String key)
           
 Map getCopyOfContextMap()
           
 void put(String key, String val)
          Put a context value (the val parameter) as identified with the key parameter into the current thread's context map.
 void remove(String key)
           
 void setContextMap(Map contextMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jMDCAdapter

public Log4jMDCAdapter()
Method Detail

clear

public void clear()
Specified by:
clear in interface MDCAdapter

get

public String get(String key)
Specified by:
get in interface MDCAdapter

put

public void put(String key,
                String val)
Put a context value (the val parameter) as identified with the key parameter into the current thread's context map. The key parameter cannot be null. Log4j does not support null for the val parameter.

This method delegates all work to log4j's MDC.

Specified by:
put in interface MDCAdapter
Throws:
IllegalArgumentException - in case the "key" or "val" parameter is null

remove

public void remove(String key)
Specified by:
remove in interface MDCAdapter

getCopyOfContextMap

public Map getCopyOfContextMap()
Specified by:
getCopyOfContextMap in interface MDCAdapter

setContextMap

public void setContextMap(Map contextMap)
Specified by:
setContextMap in interface MDCAdapter

SLF4J LOG4J-12 Binding 1.6.1-redhat-1

Copyright © 2005-2011 QOS.ch. All Rights Reserved.