Details
Description
I have been working on a library of utilities related to using SLF4J in different environments, and one functionality that I cannot seem to replicate is the ability to test if a value is already in the Nested Diagnostic Context. The only exposed public methods of the org.slf4j.NDC class are push(String) and pop(). There is a size() method that is private.
I would like to propose the inclusion of a "boolean contains(String)" method that would return whether the currently configured NDC already includes the provided value. I understand with the current approach this would involve iterating over the MDC similar to how size() does since the NDC is actually emulated with MDC keys.