Log4g Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Log4gMDC; Log4gMDCClass; void log4g_mdc_put (const gchar *key
,const gchar *value
,...
); const gchar * log4g_mdc_get (const gchar *key
); void log4g_mdc_remove (const gchar *key
); const GHashTable * log4g_mdc_get_context (void
);
The MDC class provides mapped data contexts. A mapped data context (MDC for short) is an instrument for distinguishing interleaved log output from different sources. An example of interleaved log output may occur when a server handles multiple clients simultaneously.
Mapped data context is managed on a per-thread basis. The main difference between Log4g MDCs and Log4j MDCs is that Log4g contexts are not inherited by child threads.
typedef struct { } Log4gMDCClass;
The Log4gMDCClass structure does not have any public members.
void log4g_mdc_put (const gchar *key
,const gchar *value
,...
);
Put a context value
as identified by a key
into the current thread's
context map.
If a context map has not been created for the current thread it will be created as a side-effect.
|
The key to associate with value .
|
|
The value to associate with key (accepts printf formats).
|
|
Format parameters. |
Since 0.1
const gchar * log4g_mdc_get (const gchar *key
);
Retrieve a the context value associated with a key
from the current
thread's context map.
|
The key to retrieve. |
Returns : |
The context value associated with key .
|
Since 0.1
void log4g_mdc_remove (const gchar *key
);
Remove a context value associated with a key
from the current thread's
context map.
|
The key to remove. |
Since 0.1