TomFrost / Bristol

Insanely configurable logging for Node.js
MIT License
113 stars 19 forks source link

Is it possible to add a unique request id to the logs for web apps? #49

Open arrc opened 6 years ago

arrc commented 6 years ago

I want to add a unique request id to all the logs that gets generated while serving a particular request.

I'm using expressjs and I've already figured out the request id generation part.

I tried to use the setGlobal method (I was naive 😞) but the value gets over written as soon as the server receives another request while the current request is still under operation which is normal.

Is there a way to pass the custom context related information to the logs?