-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable adding custom LogStasher fields from apps
I.e. allow apps to add their own custom fields in addition to those that `GovukJsonLogging` already adds. It looks like `LogStasher.add_custom_fields` can only be called one time, otherwise subsequent calls overwrite previous ones. We found this happening in the wild in the Content Store app, where `govuk_request_id` et al were missing from the Rails framework logs but present whenever the logger had been invoked directly from our own code. I am curious about the possibility of being able to add custom fields to both types of logs, together or separately, but the bug we're currently experiencing is just a conflict between two calls to `LogStasher.add_custom_fields`, so that's what I'm addressing. --- I've manually tested this change locally with Content Store, both with and without its own custom field config.
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters