The LoggerMDC class 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.
This class is similar to the LoggerNDC class except that it is based on a map instead of a stack.
Example:
With the properties file:
Will result in the following (notice the username "knut" in the output):
2009-09-13 18:48:28 DEBUG root knut: Testing MDC in src/examples/php/mdc.php at 23
Located in /LoggerMDC.php (line 50)
Clears the mapped diagnostic context.
Returns the context value identified by the key parameter.
Special key identifiers can be used to map values in the global $_SERVER and $_ENV vars. To access them, use 'server.' or 'env.' followed by the desired var name as the key.
Returns the contex map as an array.
Stores a context value as identified with the key parameter into the context map.
Removes the the context identified by the key parameter.
Only affects user mappings, not $_ENV or $_SERVER.
Documentation generated on Sat, 18 Feb 2012 22:32:25 +0000 by phpDocumentor 1.4.3