Make the logging always include context fields
In !96 (merged) we added the logger classes from GitLab-Rails into labkit. Now we could make sure that any message printed includes the context information. Right now, we're merging the information manually into the logging hash. We could remove the need for this on the clientside, and do this in Labkit.
We should make sure that when doing this, the logging fields passed in at the last moment by the client take precedence over the ones from the context, this will make a transition easy.
The following discussion from !96 (merged) should be addressed:
-
@reprazent started a discussion: (+1 comment) I think we can start with this, since we're just moving stuff over.
But I think it would be nice to include the entire context as the default attributes. That was always the intention with the context, we just never finished it off
🙈 . If we did this, we wouldn't need to merge it in everywhere we log something, like we're doing now in GitLab-rails.Labkit::Context.current.to_hwill include the correlation-id and everything that was part of the context. WDYT?