AndrewBystrov opened a new pull request, #4280:
URL: https://github.com/apache/logging-log4j2/pull/4280

   Fixes #4275.
   
   Restore the current thread name for fully asynchronous `AsyncLogger` events 
when `log4j2.asyncLoggerThreadNameStrategy` is set to `UNCACHED`.
   
   The thread-local translator now refreshes its thread values for the 
`UNCACHED` strategy before publishing each event. The `CACHED` strategy and the 
vararg translator behavior remain unchanged.
   
   The regression test submits two tasks to a single-thread executor, renames 
the reused worker before each log call, and verifies that both log events 
contain their corresponding thread names. The test fails against the base 
revision and passes with this fix.
   
   The test class was renamed from `AsyncLoggerTestUncachedThreadName` to 
`AsyncLoggerUncachedThreadNameTest` because the old name did not match Maven 
Surefire's default test discovery patterns. As a result, the existing test was 
not included in regular test runs, despite detecting the regression when 
executed explicitly.
   
   ## Verification
   
   * The regression test passes in both configured Disruptor test executions
   * `AsyncLoggerThreadNameStrategyTest`: 6 tests pass in both executions
   * AsyncLogger test group: 82 tests, 0 failures, 1 skipped in both executions
   * `./mvnw verify -DskipTests -pl :log4j-core,:log4j-core-test`
   * `./mvnw -N validate`
   * `git diff --check`
   
   ## Checklist
   
   * [x] Changes are based on the `2.x` branch
   * [x] Relevant Maven tests and verification checks succeed
   * [x] A changelog entry is included in `src/changelog/.2.x.x`
   * [x] A regression test is provided


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to