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: use error only notifier logging for frequent jobs [DHIS2-17998] #19949

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Feb 17, 2025

Summary

I noticed that with the changes made to the notifier where all jobs do forward at least the first and the last message (procress start/end) to the notifier jobs that do run frequently (like the housekeeping job) basically spam the log with 1 line per run through the notifier logging.

To prevent it the notifier log level is set to ERROR if a job should use non-verbose logging. This means for the first and last message where the notification is still always send the message is blanked which also prevents logging.

Automatic Testing

There is no good way of testing it and I don't think it is worth making a complicated setup to verify.

Manual Testing

  • start the server
  • check the logs for not showing a line from the DefaultNotifier once every 30 sec

@jbee jbee self-assigned this Feb 17, 2025
@jbee jbee marked this pull request as ready for review February 17, 2025 14:47
NotificationLevel level =
job.getJobType().isUsingNotifications()
job.getJobType().isUsingNotifications() && !nonVerboseLogging
Copy link
Contributor

Choose a reason for hiding this comment

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

Double negative here. Could !nonVerboseLogging just be verboseLogging? (If I'm understanding this correctly)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that too but I didn't want to inverse the logic in the function and I did not find another why to phrase it so in the end I thought the double negation was the lesser problem.

@jbee jbee merged commit 3e1aad5 into master Feb 17, 2025
17 checks passed
@jbee jbee deleted the DHIS2-17998-fix-logging branch February 17, 2025 15:50
jbee added a commit that referenced this pull request Feb 17, 2025
…19949)

* fix: use error only notifier logging for frequent jobs [DHIS2-17998]

* fix: blank first and last notifier message if INFO is not logged [DHIS2-17998]
jbee added a commit that referenced this pull request Feb 18, 2025
…19949) (#19955)

* fix: use error only notifier logging for frequent jobs [DHIS2-17998]

* fix: blank first and last notifier message if INFO is not logged [DHIS2-17998]
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.

3 participants