When using log4j2, I noticed these two system properties: "isWebApp" and "enableThreadlocals," which are mutually exclusive. According to log4j2's recommendation, enableThreadlocals should only be disabled in traditional servlet environments, while it should be enabled for embedded servlets.
link: https://github.com/apache/logging-log4j2/discussions/3376
Comment From: bclozel
I am not sure we should enable this mode either way.
In this mode Log4j uses ThreadLocals for object pooling to prevent object allocations.
Wouldn't this be really inefficient if the application is using virtual threads?