kalayciburak opened a new pull request, #4340: URL: https://github.com/apache/logging-log4j2/pull/4340
`AsyncLogger.log` stored a null `StackTraceElement` even when `includeLocation` was enabled. The `logMessage(fqcn, ...)` path already calls `calcLocationIfRequested`. Use that same fallback so a null location is filled in, and keep an explicit location unchanged. Fixes #1458 ## Checklist * Base your changes on `2.x` branch if you are targeting Log4j 2; use `main` otherwise * Non-trivial changes contain an entry file in the `src/changelog/.2.x.x` directory * Tests are provided ## Tests Executed with `JAVA_HOME` set to Java 17: * `./mvnw -pl log4j-core-test -am -Dtest=AsyncLoggerNullLocationTest -Dsurefire.failIfNoSpecifiedTests=false test` — failed on current `2.x` because the event source was null, then passed after the fix (1 test, 0 failures) * `./mvnw -pl log4j-core-test -am -Dtest=AsyncLoggerNullLocationTest,AsyncLoggerLocationTest,AsyncLoggerDefaultLocationTest,AsyncLoggerTest -Dsurefire.failIfNoSpecifiedTests=false test` — 4 tests, 0 failures * `./mvnw -pl log4j-core,log4j-core-test -am spotless:check` — passed Full `./mvnw verify` was not run. -- 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]
