[ https://issues.apache.org/jira/browse/LOG4J2-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466445#comment-13466445 ]
Joern Huxhorn commented on LOG4J2-83: ------------------------------------- Not really since the map wouldn't be empty at all in my cases. We use MDC quite extensively, i.e. 10-15 key-value-pairs per event. We never ever read values from the MDC in our application code. The MDC is used purely for logging and not as some magic bucket for moving around objects across method calls. Because of this, it would be feasible to disable MDC handling altogether. I suspect that most code is using the MDC like this, i.e. only writing, never reading (I've never seen any MDC values of libraries in my events). Chances are quite high that an application would work exactly the same way with MDC disabled, just a lot faster. While disabling MDC could lead to application breakage if the application is indeed reading from the MDC I don't understand the problem about this. I'd just not disable the MDC in that case. This is comparable to pulling the network cable for an application that is using the network. Yep, it will cause breakage. Just don't do it in those cases. > Please provide means to disable MDC functionality on a global level. > -------------------------------------------------------------------- > > Key: LOG4J2-83 > URL: https://issues.apache.org/jira/browse/LOG4J2-83 > Project: Log4j 2 > Issue Type: New Feature > Reporter: Joern Huxhorn > > Disabling MDC evaluation can have drastic effects on event size while sending > them over the wire or dumping them to disk. > When disabled, all calls to MDC-related methods will instead call NOP > implementations, i.e. no ThreadLocals would be used at all. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org