Skip to content
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

Add trace correlation to agent logs #2495

Open
eyalkoren opened this issue Mar 3, 2022 · 0 comments
Open

Add trace correlation to agent logs #2495

eyalkoren opened this issue Mar 3, 2022 · 0 comments
Labels
agent-java enhancement Enhancement of an existing feature logging application logging instrumentation and support

Comments

@eyalkoren
Copy link
Contributor

Is your feature request related to a problem?

When agent logs in ECS format, we can utilize log correlation to our logs as well.

Describe the solution you'd like

We can enhance our co.elastic.apm.agent.logging.Log4j2LoggerBridge to add to slf4j MDC before any logging event and removing after if the log format is JSON.

Describe alternatives you've considered

Another option is to utilize log4j extension capabilities - org.apache.logging.log4j.core.util.ContextDataProvider or org.apache.logging.log4j.core.ContextDataInjector

Additional context

Followup on #2428

@felixbarny felixbarny added the logging application logging instrumentation and support label Mar 4, 2022
@SylvainJuge SylvainJuge added the enhancement Enhancement of an existing feature label Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java enhancement Enhancement of an existing feature logging application logging instrumentation and support
Projects
None yet
Development

No branches or pull requests

4 participants