Log4j2 - Support the use of async appenders when using the standard Pattern Layout #2096
Labels
GTSE
There is an associated support escalation with this issue.
Milestone
Original GTSE: https://new-relic.atlassian.net/jira/software/c/projects/NR/boards/289?selectedIssue=NR-323639
When using a Log4j async appender and the Pattern layout, trace id and span id are not properly added to the log event metadata because of a thread hop, which results in the active transaction no longer being available.
Module: https://github.com/newrelic/newrelic-java-agent/tree/main/instrumentation/apache-log4j-2.11
It might be possible to instrument a super class of the layout classes and instrument the
toSerializable()
method similarly to how the current AbstractJacksonLayout_Instrumentation is instrumented.To enable async appenders in a project do the following:
log4j2.component.properties
in the same folder where thelog4j2.xml
file existsAn example
log4j2.xml
that configures a simple pattern layout with a console appender:https://new-relic.atlassian.net/browse/NR-323639
The text was updated successfully, but these errors were encountered: