apm-agent-java icon indicating copy to clipboard operation
apm-agent-java copied to clipboard

Add instrumentation for Log4j2 with AsyncLoggerContextSelector that enables log correlation

Open jackshirazi opened this issue 2 years ago • 3 comments

Is your feature request related to a problem?

If using LOG4J in async logging with AsyncLoggerContextSelector, log correlation doesn't happen, see this discussion

Describe the solution you'd like

Log correlation should work the same as per sync log4j logging

jackshirazi avatar May 03 '23 12:05 jackshirazi

@jackshirazi are there any workarounds for this currently (to enrich logs with trace.id when async logging is enabled for Log4J2?

maggieghamry avatar Dec 06 '23 16:12 maggieghamry

Unfortunately not

jackshirazi avatar Dec 07 '23 14:12 jackshirazi

@maggieghamry @jackshirazi There's a workaround, see https://gist.github.com/kelunik/c3971068a7d1a1f0acd7c2143028ce1b, which is also linked in the above linked original discussion.

kelunik avatar Jan 04 '24 08:01 kelunik