My point was really the contract in the API javadoc should be updated and we should implement that contract..if we neeed new APIs, that's ok..or if I'm forced to create a new Log4jevent I'll deal with the contract.


On Sun, Aug 5, 2012 at 9:32 PM, Ralph Goers <> wrote:
In the Log4j 2 API the getContext and cloneStack methods of ThreadContext return copies of the Map and Stack.  In the LogEvent in impl getContextMap and getContextStack return the actual Map and Stack that are in the LogEvent. Copying them would be too expensive.

I don't know that there are any components yet that can add, delete or modify MDC keys or values, but i know that such a feature would be desired.  That said, the RewriteAppender uses the RewritePolicy which creates a new LogEvent.


On Aug 5, 2012, at 7:16 PM, Scott Deboy wrote:

> Chainsaw and some Receivers add properties to events to support tracking, for example, log4jid is added by Chainsaw.
> One thing that needs to be clarified in the api contract is whether or not getContextMap and getContextStack give you a copy of the map/stack or the original, as again, Chainsaw and others will need to use some api to modify those values.
> Scott

To unsubscribe, e-mail:
For additional commands, e-mail: