Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON logging support #3303

Closed

Conversation

nullishamy
Copy link
Contributor

@nullishamy nullishamy commented Sep 6, 2023

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

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.
@Jerrie-Aries
Copy link
Contributor

Cool feature.

However, usually PRs should point to development branch. Plus we had quite a few of changes with logging in development (merged). Maybe you should take a look to avoid merge conflicts.

@nullishamy nullishamy changed the base branch from master to development September 9, 2023 12:53
@nullishamy
Copy link
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!

Copy link
Contributor

@Jerrie-Aries Jerrie-Aries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

bot.py Outdated Show resolved Hide resolved
bot.py Outdated Show resolved Hide resolved
@nullishamy
Copy link
Contributor Author

Right, well that's those changes made. Can wait for Taku's review now.

@nullishamy nullishamy closed this Sep 12, 2023
@nullishamy nullishamy deleted the feat/json-logging branch September 12, 2023 17:53
@nullishamy nullishamy restored the feat/json-logging branch September 14, 2023 17:56
@nullishamy nullishamy deleted the feat/json-logging branch October 7, 2023 07:48
@nullishamy nullishamy restored the feat/json-logging branch October 25, 2023 19:32
@nullishamy nullishamy deleted the feat/json-logging branch October 27, 2023 18:15
@nullishamy nullishamy restored the feat/json-logging branch October 27, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON format log output
2 participants