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 Mapped Diagnostic Context data to LogEvents as attributes #801

Closed
jasonjkeller opened this issue Mar 22, 2022 · 1 comment · Fixed by #866
Closed

Add Mapped Diagnostic Context data to LogEvents as attributes #801

jasonjkeller opened this issue Mar 22, 2022 · 1 comment · Fixed by #866

Comments

@jasonjkeller
Copy link
Contributor

Some log libraries provide APIs for adding context data to log messages using MDC. Customers will likely want this data captured and included on LogEvents. We should explore capturing this data for supported log libraries.

Mapped Diagnostic Context (MDC)
A typical distributed system is multithreaded, with different threads serving different requests from different clients. Each thread has its own specific context. Contextual metadata in your logs—such as user ID, client host, session information, query data, etc.—can be invaluable to getting more insight into how your application is performing and which users are experiencing problems.

Log4J, Log4J2, and Logback all support Mapped Diagnostic Context, or MDC, which lets you store key-value pairs that are then added to your log data. This is particularly useful if you are logging to JSON because these contextual attributes can then be used to filter and sort your logs.

@StanlieK
Copy link
Contributor

@jasonjkeller Hey! As you may have seen, I've created pull-request for this feature #866.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants