-
Notifications
You must be signed in to change notification settings - Fork 359
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
Conversation
|
NotificationLevel level = | ||
job.getJobType().isUsingNotifications() | ||
job.getJobType().isUsingNotifications() && !nonVerboseLogging |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
…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]
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
DefaultNotifier
once every 30 sec