Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the output of our JSON logs to follow the
bunyan
format.Bunyan provides a bit of a standardized approach to what fields we log, and also adds more context to our JSON logs than what we currently have.
The libray we're using does also mention that events will have access to the parent span's context. I've been trying to manually trace this through our logs and I'm not entirely sure how to properly make use of this - but could be handy as well.
Couple of downsides here:
Span
s (e.g entering and exiting).INFO
,DEBUG
, etc.)RUST_LOG
, this is more about interpreting the output after the factSince I expect that these logs are going to go into some sort of aggregator for later analysis it doesn't seem like a huge deal that they're more verbose. However, it could also come back to bite us if we have too many logs and can't understand what they're trying to tell us while debugging issues.
If this turns out to be overkill we can always change the formatting. I'm not tied to bunyan - it's just something I saw come up a few times during the last couple of weeks.
Here is an example of what the output looks like:
The same logs can be pretty printed in your terminal using a Bunyan CLI tool (here's one written in Rust).
Below is a sample of what that looks like.
Part of #498.