Chris - by any chance are the messages that are ending up in the wrong context's log coming from commons-logging API loggers? I seem to have narrowed down my issue to just statements logged through the jcl-over-slf4j dependency. It seems like straight slf4j Logger statements are logging to the correct log files.<br>
<br><div class="gmail_quote">On Thu, Aug 16, 2012 at 12:21 PM, Chris Rompot <span dir="ltr"><<a href="mailto:crompot@gmail.com" target="_blank">crompot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
We are doing the same with a HashMap, except our key is an class (with<br>
appropriately implemented hashCode()) composed of two String attributes.<br>
<div><div class="h5"><br>
<br>
Robert Voliva-2 wrote:<br>
><br>
> We're using a String, the context name, as the Map's Key.<br>
><br>
> private final Map<String, LoggerContext> synchronizedContextMap;<br>
><br>
> this.synchronizedContextMap = Collections.synchronizedMap(new<br>
> HashMap<String, LoggerContext>());<br>
><br>
><br>
> On Thu, Aug 16, 2012 at 11:20 AM, ceki <<a href="mailto:ceki@qos.ch">ceki@qos.ch</a>> wrote:<br>
><br>
>> On 16.08.2012 18:01, Chris Rompot wrote:<br>
>><br>
>>><br>
>>><br>
>>> Ceki Gulcu wrote:<br>
>>><br>
>>>><br>
>>>><br>
>>>> If my memory serves me correctly, the context selection code has not<br>
>>>> changed significantly since 0.9.28.<br>
>>>><br>
>>>> How do you perform context selection? Is it JNDI based? Again, what<br>
>>>> happens when you revert to logback 0.9.28?<br>
>>>><br>
>>>> --<br>
>>>> Ceki<br>
>>>> <a href="http://tinyurl.com/proLogback" target="_blank">http://tinyurl.com/proLogback</a><br>
>>>><br>
>>>><br>
>>> We recently noticed the same problem using logback-classic version<br>
>>> 1.0.6.<br>
>>> We<br>
>>> store our LoggerContexts as values of a static HashMap. I have verified<br>
>>> that<br>
>>> the keys used to retrieve the appropriate LoggerContext have distinct<br>
>>> hash<br>
>>> codes. In the example that we noticed, the appropriate context was used<br>
>>> on<br>
>>> 2012-08-15 11:48:58 - 15:48:07 after which it was no longer used. Log<br>
>>> entries that should have gone to it were mixed in with those for a newly<br>
>>> created context from 2012-08-15 15:48:28 on.<br>
>>><br>
>><br>
>> LoggerContext does not implement hashCode() nor equals(). What is the key<br>
>> used to retrieve values in the map?<br>
>><br>
>><br>
>> --<br>
>> Ceki<br>
>> <a href="http://tinyurl.com/proLogback" target="_blank">http://tinyurl.com/proLogback</a><br>
>><br>
</div></div>>> ______________________________**_________________<br>
>> Logback-user mailing list<br>
>> <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
>> <a href="http://mailman.qos.ch/mailman/**listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/**listinfo/logback-user</a><<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a>><br>
<div class="im HOEnZb">>><br>
><br>
> _______________________________________________<br>
> Logback-user mailing list<br>
> <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
><br>
<br>
</div><span class="HOEnZb"><font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/Logging-crossing-contexts-tp34292668p34307989.html" target="_blank">http://old.nabble.com/Logging-crossing-contexts-tp34292668p34307989.html</a><br>
</font></span><div class="im HOEnZb">Sent from the Logback User mailing list archive at Nabble.com.<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
</div></div></blockquote></div><br>