[logback-user] Any way to turn off MDC inheritance?

White, Joshua A A6IT Joshua.White at Cigna.com
Tue Sep 1 00:56:30 CEST 2015


Thanks for the reply.  I use that approach for other areas of my app.  I was hoping to be able to disable MDC inheritance so it doesn't impact other areas of my app where I can't manage the lifecycle of other thread pools.

Really, if your managing the propagation of the MDC yourself, it would be nice to opt out of the inheritance mechanism.

Anyone figure out how to get around this?

________________________________
From: Logback-user <logback-user-bounces at qos.ch> on behalf of Paul Krause <pkrause at investsoftech.com>
Sent: Monday, August 31, 2015 5:34:27 PM
To: logback users list
Subject: Re: [logback-user] Any way to turn off MDC inheritance?

If you know what information you want to keep and what you want to discard, then you should be able use MDC.getCopyOfContextMap() and MDC.setContextMapValues() to clean up the MDC.  But you'll need to figure out when to call them based on the API that the thread-pool exposes to you.

From: Logback-user [mailto:logback-user-bounces at qos.ch] On Behalf Of White, Joshua A A6IT
Sent: Monday, August 31, 2015 5:21 PM
To: logback-user at qos.ch
Subject: [logback-user] Any way to turn off MDC inheritance?

Hello,

I am using logback version 1.1.3.   I have a situation where the MDC is getting copied over to thread pools that I don't manage and filling my logs with log statements that contain MDC information that is no longer valid.  Because I don't manage these thread pools, I am not able to copy the correct values to that thread pool when threads get used/re-used).

Does anyone have a solution for this problem?

-Joshua

------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error,
please immediately notify the sender by e-mail at the address shown.
This email transmission may contain confidential information.  This
information is intended only for the use of the individual(s) or entity to
whom it is intended even if addressed incorrectly.  Please delete it from
your files if you are not the intended recipient.  Thank you for your
compliance.  Copyright (c) 2015 Cigna
==============================================================================
------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error,
please immediately notify the sender by e-mail at the address shown. 
This email transmission may contain confidential information.  This
information is intended only for the use of the individual(s) or entity to
whom it is intended even if addressed incorrectly.  Please delete it from
your files if you are not the intended recipient.  Thank you for your
compliance.  Copyright (c) 2015 Cigna
==============================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20150831/9cc01bd3/attachment-0001.html>


More information about the Logback-user mailing list