Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
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
- is related to
-
LOG4J2-2635 Wrong java.version check in ThreadNameCachingStrategy
- Closed
- relates to
-
LOG4J2-467 Thread name caching in async logger incompatible with use of Thread.setName()
- Closed