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

Fix JSON line logging #3511

Merged
merged 7 commits into from
Sep 17, 2024
Merged

Fix JSON line logging #3511

merged 7 commits into from
Sep 17, 2024

Conversation

ammar92
Copy link
Contributor

@ammar92 ammar92 commented Sep 11, 2024

Changes

This implementation updates the default logging format to support both text and JSON line logging. It also fixes the double-formatted JSON logging issue in Rocky caused by a misconfiguration. Additionally, a few event codes have been added for the Octopoes API connector.

Issue link

(Partially) closes #3397

Demo

image

QA notes

Set the following environment keys:

SCHEDULER_LOGGING_FORMAT=json
BOEFJES_LOGGING_FORMAT=json
BYTES_LOGGING_FORMAT=json
OCTOPOES_LOGGING_FORMAT=json
LOGGING_FORMAT=json

The services should produce JSON logs generated by OpenKAT in the following format:

{"event": ..., "level": ..., ...}

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@ammar92 ammar92 requested a review from a team as a code owner September 11, 2024 06:17
@underdarknl
Copy link
Contributor

Lets add this to the Docs.

@underdarknl underdarknl reopened this Sep 11, 2024
@@ -0,0 +1,6 @@
# Event codes for certain actions
OBSERVATION_CREATED = 100101
Copy link
Contributor

Choose a reason for hiding this comment

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

I've added these to
#3043

@underdarknl underdarknl merged commit 6d0caeb into main Sep 17, 2024
26 checks passed
@underdarknl underdarknl deleted the feature/json-line-logging branch September 17, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Produce JSON-line output when JSON logging is configured
2 participants