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?
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?