Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members | Related Pages

MDC Class Reference

List of all members.

Public Types

typedef std::map< String,
String > 
Map

Static Public Member Functions

void put (const String &key, const String &value)
String get (const String &key)
String remove (const String &key)
void clear ()
const Map getContext ()

Detailed Description

The MDC class is similar to the NDC class except that it is based on a map instead of a stack. It provides mapped diagnostic contexts. A Mapped Diagnostic Context, or MDC in short, is an instrument for distinguishing interleaved log output from different sources. Log output is typically interleaved when a server handles multiple clients near-simultaneously.

The MDC is managed on a per thread basis. A child thread automatically inherits a copy of the mapped diagnostic context of its parent.

The MDC class requires JDK 1.2 or above. Under JDK 1.1 the MDC will always return empty values but otherwise will not affect or harm your application.


Member Typedef Documentation

typedef std::map<String, String> Map
 

String to string stl mp


Member Function Documentation

void clear  )  [static]
 

Clear all entries in the MDC.

String get const String &  key  )  [static]
 

Get the context identified by the key parameter.

This method has no side effects.

const MDC::Map getContext  )  [static]
 

Get the current thread's MDC as a Map. This method is intended to be used internally.

void put const String &  key,
const String &  value
[static]
 

Put a context value (the o parameter) as identified with the key parameter into the current thread's context map.

If the current thread does not have a context map it is created as a side effect.

String remove const String &  key  )  [static]
 

Remove the the context identified by the key parameter.


The documentation for this class was generated from the following files:
Generated on Sat Jul 22 10:25:22 2006 for log4cxx by  doxygen 1.3.9.1