Re: MDC::put won't overwrite an existing value

2008-04-16 Thread Dale King
They were in the same thread . In reality it was a loop in a demo program to demonstrate log4cxx to people where I work so that we switch to it. In reality there was only statement that get executed each time through the loop with different data. In my testing the data in the MDC got stuck at the f

Re: MDC::put won't overwrite an existing value

2008-04-16 Thread Jacob L. Anawalt
Curt Arnold wrote: ".. insertion takes place only if there is not already an element in the m (map) with that key." Right. I usually take the easy way (less lines of code) out with the operator[] override unless I need to know that the key existed before inserting a new one or replacing i

Re: MDC::put won't overwrite an existing value

2008-04-16 Thread Curt Arnold
On Apr 16, 2008, at 10:33 AM, Jacob L. Anawalt wrote: Dale King wrote: MDC::put( "key", "value1" ); MDC::put( "key", "value2" ); Without a code example, I must ask; are these MDC::put calls in the same thread right next to each other? The attached program correctly swaps keys in 0.9.

Re: MDC::put won't overwrite an existing value

2008-04-16 Thread Jacob L. Anawalt
Dale King wrote: MDC::put( "key", "value1" ); MDC::put( "key", "value2" ); Without a code example, I must ask; are these MDC::put calls in the same thread right next to each other? The attached program correctly swaps keys in 0.9.7. I don't have an installed 0.10.0 build handy at the

MDC::put won't overwrite an existing value

2008-04-15 Thread Dale King
Not sure if this was by design and not sure if the equivalent log4j behaves the same way, but MDC::put will not overwrite an existing property with a new one. The new one is just ignored. For example: MDC::put( "key", "value1" ); MDC::put( "key", "value2" ); Will result in the key property