express-http-context icon indicating copy to clipboard operation
express-http-context copied to clipboard

using express-http-context with sails js

Open vphuclh1 opened this issue 5 years ago • 1 comments

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

vphuclh1 avatar Jan 27 '20 15:01 vphuclh1

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

zhujun24 avatar Apr 22 '20 12:04 zhujun24