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 context/IDs to standard logging (MDC) #163

Open
pavolloffay opened this issue Dec 16, 2019 · 3 comments
Open

Add trace context/IDs to standard logging (MDC) #163

pavolloffay opened this issue Dec 16, 2019 · 3 comments

Comments

@pavolloffay
Copy link
Contributor

Add trace context/IDs to standard logging output. It allows correlating standard logging with traces.

References to requests for this feature in other libraries

To make this possible in MicroProfile there should be agreement on the logging framework supporting MDC and also update to OpenTracing 0.33.0 which exposes trace IDs.

@donbourne
Copy link

I would suggest that we could do this without having to tie in any particular requirements to the logging framework. ie. That the OpenTracing / OpenTelemetry specs could indicate that server implementations should include the span and trace IDs in all logs/trace generated within those spans/traces. Then just leave it up to the impls to decide what to use for MDC based on their logging framework.

@pavolloffay
Copy link
Contributor Author

Then is there a way to test this then?

@donbourne
Copy link

A couple of ideas...

  1. Perhaps the TCK could add an API to allow checking what gets written to the logs by the target server.
  2. The MP OpenTracing API could include a minimal MDC API that vendors could plug their impl into.

I think the 2nd option would be easier to implement, but might seem out of place in the MP OpenTracing API.

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

No branches or pull requests

2 participants