Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1348

Add an AutoCloseable ThreadContext class: CloseableThreadContext

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.6
    • API
    • None

    Description

      The log4j2 API provides a ThreadContext - https://logging.apache.org/log4j/2.x/manual/thread-context.html - that allows items to be added to a stack or a map for logging, and then subsequently removed once they are no longer required.

      This sounds like an ideal candidate for a AutoCloseable implementation so that items are removed automatically and no longer left around littering the stack/map.

      Attachments

        1. thread-context.xml.patch
          2 kB
          Greg Thomas
        2. ctc-instance.patch
          20 kB
          Greg Thomas
        3. ctc-also.patch
          16 kB
          Greg Thomas
        4. ctc.patch
          16 kB
          Greg Thomas
        5. CloseableThreadContext.zip
          2 kB
          Greg Thomas

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ggregory Gary D. Gregory
            gdt Greg Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment