logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan.Borovac@t-online.de" <Stefan.Boro...@t-online.de>
Subject Non thread private MDC values.
Date Tue, 04 Nov 2008 13:12:02 GMT


I would like to raise an issue concerning the MDC (in log4cxx 0.10.0 and
log4j 1.2). 

Is it possible to introduce MDC key-value pairs, say generalised MDC
values, which are not thread privat?

I like the concept of MDC but have the problem of logging many instances
of the same application (with many threads) running on many hosts. The
messages logged are send to a remote logging instance. Usually, we
cannot distinguish between the instances running on the same host. Here
I use the MDC. 

In this situation, a generalisation of the MDC would give me the
possibility to add values which help me to distinguish between the
instances (without carrying this information within the log-message).
The advantage of this generalised MDC is the existing treatment of the
MDC values (XMLSocketAppender, XMLSocketReceiver, DBAppender). Perhaps
it is sufficient to add a generalised 'put' and 'get' method to a
'global' hash in the MDC.

In the moment, I have to look whether the MDC still has values which
consumes unnecessary time (and  this is rather uncool).

Perhaps you have a better clou to this point. If so, please let me know.


View raw message