Class LoggerMDC

Description

The LoggerMDC class is similar to the LoggerNDC class except that it is based on a map instead of a stack.

The LoggerMDC class is similar to the LoggerNDC 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.

Located in Program_Root/src/log4php/LoggerMDC.php (line 46)


	
			
Method Summary
string get (mixed $key)
void put (string $key, string $value)
void remove (mixed $key)
Methods
get (line 79)

Get the context identified by the key parameter.

Get the context identified by the key parameter. You can use special key identifiers to map values in PHP $_SERVER and $_ENV vars. Just put a 'server.' or 'env.' followed by the var name you want to refer.

This method has no side effects.

  • static:
string get (mixed $key)
put (line 61)

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

Put a context value 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.

Note that you cannot put more than LOGGER_MDC_HT_SIZE keys.

  • static:
void put (string $key, string $value)
  • string $key: the key
  • string $value: the value
remove (line 114)

Remove the the context identified by the key parameter.

Remove the the context identified by the key parameter. It only affects user mappings.

  • static:
void remove (mixed $key)

Documentation generated on Wed, 27 Aug 2003 18:11:44 +0200 by phpDocumentor 1.2.2