-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log4j2 - Support the use of async appenders when using the standard Pattern Layout #2096
Comments
We're going to place this back on the backlog. Implementing a fix for this will require a significant refactoring of the log4j instrumentation modules, as well as changes to the log sender service which is used across all logger instrumentation modules. Two options were explored:
|
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: