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

Make a way to shove extra logging information into the MDC for promises as they resolve #70

Open
nwertzberger opened this issue Feb 3, 2016 · 3 comments

Comments

@nwertzberger
Copy link

Logging frameworks have a thing called an MDC. It's a way to store extra metadata that then gets logged with every message in that thread. They use ThreadLocal to implement this. With this move to promises, the thread a request is running on is not often the same one that initiated it.

I propose we add a boolean optional function call on promises, with a static global setter as well, that says to "preserveIssuerMdc" on promise resolutions.

If this is true, we build out the resolving thread's mdc to match the issuer's mdc exactly before calling promise callbacks.

The issuer is determined to be the caller of done(), fail(), progress(), then(). Every instantiation of this would store a reference to the parent mdc.

If anyone's interested, i'd be happy to make a fork to do this change. It might be somewhat expansive.

@saturnism
Copy link
Member

Hiya - could I trouble you to propose the actual method signatures? Let's see how we can seamlessly add this - it sounds very useful to debug concurrent processes.

@saturnism saturnism added this to the 1.3 milestone Apr 30, 2016
@saturnism saturnism self-assigned this Apr 30, 2016
@saturnism saturnism removed this from the 1.3 milestone Oct 28, 2017
@saturnism
Copy link
Member

Quick ping, could def use help here for 2.x :)

@aalmiray
Copy link
Contributor

calculating MDC is what kills logging frameworks btw

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

3 participants