Add JSON logging support#3303
Closed
nullishamy wants to merge 8 commits intomodmail-dev:developmentfrom
Closed
Conversation
This adds support for JSON logging, along with the relevant options required. This does not change the default log behaviour, so should be backwards compatible. It is opt in via the LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback to the old behaviour. This is implemented in terms of a custom formatter, which is optionally applied to the stdout stream. The debug stream is unaffected by this.
Contributor
|
Cool feature. However, usually PRs should point to |
Contributor
Author
|
That's done. Hope I understood what was going on with those commits in development, let me know if I changed / removed any code / functionality! |
Jerrie-Aries
reviewed
Sep 9, 2023
Contributor
Jerrie-Aries
left a comment
There was a problem hiding this comment.
Just pointed up two things there.
Also if new config options were added (stream_log_format, file_log_format), it would be better if the help docs for those are also added in core/config_help.json.
Other than that, you need @Taaku18 to review this thoroughly.
Contributor
Author
|
Right, well that's those changes made. Can wait for Taku's review now. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds support for JSON logging, along with the relevant options required.
This does not change the default log behaviour, so should be backwards compatible.
It is opt in via the {STREAM,FILE}_LOG_FORMAT option, which can be 'json' to use the new logger, or anything else to fallback to the old behaviour.
This is implemented in terms of a custom formatter, which is optionally applied to the log streams.
Closes #3246