Add ActiveSupport tagged logging support #1344
Open
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.
Don't use thread vars in logger
To temporarily set the attributes in the logger instance, use instance variables instead of Thread variables.
I don't know why Thread variables are used here. I don't think it's needed.
Add ActiveSupport tagged logging support
Our logger did not support Rails ActiveSupport tagged logging yet. This was because our logger didn't listen to the
tagged
,push_tags
andpop_tags
methods.Implement these methods to have the logger that wraps our logger call these methods to set tags.
The format is the same as Rails formats it:
[My tag value]
I decide not to set these as attributes, because they're only values. They have no key and the value can be anything and change frequently.