JBoss Log Manager 1.2.0.GA

org.jboss.logmanager
Class MDC

java.lang.Object
  extended by org.jboss.logmanager.MDC

public final class MDC
extends Object

Mapped diagnostic context. This is a thread-local map used to hold loggable information.


Method Summary
static void clear()
          Clear the current MDC map.
static Map<String,String> copy()
          Get a copy of the MDC map.
static String get(String key)
          Get the value for a key, or null if there is no mapping.
static String put(String key, String value)
          Set the value of a key, returning the old value (if any) or null if there was none.
static String remove(String key)
          Remove a key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static String get(String key)
Get the value for a key, or null if there is no mapping.

Parameters:
key - the key
Returns:
the value

put

public static String put(String key,
                         String value)
Set the value of a key, returning the old value (if any) or null if there was none.

Parameters:
key - the key
value - the new value
Returns:
the old value or null if there was none

remove

public static String remove(String key)
Remove a key.

Parameters:
key - the key
Returns:
the old value or null if there was none

copy

public static Map<String,String> copy()
Get a copy of the MDC map. This is a relatively expensive operation.

Returns:
a copy of the map

clear

public static void clear()
Clear the current MDC map.


JBoss Log Manager 1.2.0.GA

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.