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

using express-http-context with sails js #47

Open
vphuclh1 opened this issue Jan 27, 2020 · 1 comment
Open

using express-http-context with sails js #47

vphuclh1 opened this issue Jan 27, 2020 · 1 comment

Comments

@vphuclh1
Copy link

I use express-http-context with middleware writing log when a request coming, and store the unique id for in http context using httpContext.set('reqId', req.requestInfo.id);, and with every log using console.log or console.error, i override them to print the unique id using httpContext.get('reqId').
The problem is that I can't get the id, it is jus the blank.
Is there someone get this problem? If so, please help me to solve it. Thank you

@zhujun24
Copy link

I have write a tidy npm package http-request-context to do this, using async_hooks, u can try it.

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

No branches or pull requests

2 participants