Closed golonzovsky closed 4 months ago
The request id is encapsulated in request
object.
Can you explain in what case it would collide?
ah, if id
would be in request
object - it will totally work for me even without customization 👍🏻
Current behavior adds request id into base attributes, not in request attributes https://github.com/samber/slog-chi/blob/main/middleware.go#L160
Let me know if I should change this PR to move request id from baseAttributes
to requestAttributes
to achieve intended behavior (but its a breaking change)?
oops, you're right, i read the code too fast
let's merge!
Current 'id' key for request id is very generic and often collides with existing ids.
This change introduces possibility to configure request id key in a non-breaking way.
It is made in a same way as recently introduced customization for trace/span keys.