Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-522

Add contains() Method to NDC

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 2.0.14
    • 2.0.0-alpha4
    • slf4j-ext
    • enhancement

    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.

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            mwootendev Michael Wooten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: