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

Disable thread name caching by default

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.10.0
    • None
    • None

    Description

      We run our tests in parallel with TestNG and we use Thread.setName() for easy filtering of log messages from a single test. But since LOG4J2-1334, all the thread names are logged as TestNG, unless we use -DAsyncLogger.ThreadNameStrategy=UNCACHED.

      JDK 8u102 removed the String allocation in Thread.getName() (https://bugs.openjdk.java.net/browse/JDK-8148842), so I suggest changing the default strategy to UNCACHED. Users of older JDKs will still be able to use -DAsyncLogger.ThreadNameStrategy=CACHED for the performance improvement.

      Attachments

        Issue Links

        Activity

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

          People

            rpopma Remko Popma
            dan.berindei Dan Berindei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment