Getting null from getPropertyMap in LogbackMDCAdapter in the same thread, different binary

After switching from log4j to logback, I am getting null from getPropertyMap() in LogbackMDCAdapter. I can confirm that it's the same thread where the value is being put. However the put is called in a different binary (same JVM of course). If logging is done in the same codebase (binary) where MDC put is called, it works as expected bug it the logger is invoked from a different binary, copyOnInheritThreadLocal.get() in getPropertyMap() is returning null. Any suggestions? Thanks!

On 04/08/2011 7:46 PM, GS wrote:
After switching from log4j to logback, I am getting null from getPropertyMap() in LogbackMDCAdapter. I can confirm that it's the same thread where the value is being put. However the put is called in a different binary (same JVM of course).
What do you mean by "put is called in a different binary"? -- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html

I have a turbofilter (MDCFilter) configured and I do MDC.put in one binary (sessionstuff.jar) and the logger is called in another binary (mywebapp.war), which is where the MDCFilter is called for a decision and the property map is now missing (null). On Thu, Aug 4, 2011 at 4:27 PM, Ceki Gülcü <ceki@qos.ch> wrote:
On 04/08/2011 7:46 PM, GS wrote:
After switching from log4j to logback, I am getting null from getPropertyMap() in LogbackMDCAdapter. I can confirm that it's the same thread where the value is being put. However the put is called in a different binary (same JVM of course).
What do you mean by "put is called in a different binary"?
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html ______________________________**_________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/**listinfo/logback-user<http://qos.ch/mailman/listinfo/logback-user>

On 04/08/2011 10:39 PM, GS wrote:
I have a turbofilter (MDCFilter) configured and I do MDC.put in one binary (sessionstuff.jar) and the logger is called in another binary (mywebapp.war), which is where the MDCFilter is called for a decision and the property map is now missing (null).
Thanks for the response. The binary from which the call is made is irrelevant. Can you reproduce the problem in a unit test? -- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html

Just figured it out. It was caused due to multiple slf4j bindings. After excluding some redundant jars from the classpath, the issue went away. Thanks for your help Ceki. On Thu, Aug 4, 2011 at 5:18 PM, Ceki Gülcü <ceki@qos.ch> wrote:
On 04/08/2011 10:39 PM, GS wrote:
I have a turbofilter (MDCFilter) configured and I do MDC.put in one binary (sessionstuff.jar) and the logger is called in another binary (mywebapp.war), which is where the MDCFilter is called for a decision and the property map is now missing (null).
Thanks for the response. The binary from which the call is made is irrelevant. Can you reproduce the problem in a unit test?
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html ______________________________**_________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/**listinfo/logback-user<http://qos.ch/mailman/listinfo/logback-user>

I think I'm having the same issue....multiple SLF4J bindings... but because of Spring (i think??) On Thu, Aug 4, 2011 at 5:22 PM, GS <gurnamsjunk@gmail.com> wrote:
Just figured it out. It was caused due to multiple slf4j bindings. After excluding some redundant jars from the classpath, the issue went away. Thanks for your help Ceki. On Thu, Aug 4, 2011 at 5:18 PM, Ceki Gülcü <ceki@qos.ch> wrote:
On 04/08/2011 10:39 PM, GS wrote:
I have a turbofilter (MDCFilter) configured and I do MDC.put in one binary (sessionstuff.jar) and the logger is called in another binary (mywebapp.war), which is where the MDCFilter is called for a decision and the property map is now missing (null).
Thanks for the response. The binary from which the call is made is irrelevant. Can you reproduce the problem in a unit test?
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Jason Berk http://picasaweb.google.com/JasonRBerk
participants (3)
-
Ceki Gülcü
-
GS
-
Jason Berk