Seeing a lot of log entries like this: "1 log entries removed for job dblog_cron". That's a lot of noise.
We should either find a way to do a single log entry or remove it completely.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 2798589-ultimate_cron-reducelogging-17.patch | 2.68 KB | Jorrit |
| #15 | ultimate-cron_2798589_database-logger-d7.patch | 1.77 KB | Anonymous (not verified) |
| #12 | ultimate-cron_2798589_database-logger-d7.patch | 1.77 KB | Anonymous (not verified) |
| #6 | interdiff-2798589-4-6.txt | 1.58 KB | ModernMantra |
| #6 | database_logger-2798589-6.patch | 2.01 KB | ModernMantra |
Comments
Comment #2
ModernMantra commentedMade some progress, hope it is good :)
Comment #3
berdirnot for job @name, but "for @count jobs". you're outside of the loop here, this will simply only report it for the last job.
you need to count deleted messages together and also count the jobs for which messages were deleted but only if ther was at least one.
Comment #4
ModernMantra commentedCHanged the logic and structure considering comment #3. Hope it looks better.
Comment #5
berdircounter is just the count of the last job. you need to sum them together. and as I wrote, only count jobs for which you actually delete messages:
if ($counter) {
$counters[$job->id()] = $counter;
}
For example like that, then you can use count() and array_sum()
Comment #6
ModernMantra commentedChanged a little bit a logic considering comment #5. I apologize for my previous patch and not reading carefully comments/review.
Comment #8
berdirYes, I think this is correct now. Tests would be nice but seems to be pretty complex to add useful tests.
Comment #9
Anonymous (not verified) commentedI agree with this, this is spamming the heck out of our logs.
Comment #10
Anonymous (not verified) commentedThis needs a backport to 7.
Comment #11
berdirFeel free to re-open and set to 7.x. But plently of similar 7.x issues have been closed with the suggestion to use some watchdog filter module. I don't maintain that version.
Comment #12
Anonymous (not verified) commentedHere's a stab at D7.
Comment #13
Anonymous (not verified) commentedComment #15
Anonymous (not verified) commentedComment #16
Triqueon commentedI would suggest moving the return statement out of the if-block in the final change block. Probably you'll be fine without it, I believe PHP imlicitly returns null from methods missing a return statement (which you would be in this case if count is 0), which also maps to false, but it's not clean, and you can eliminate the unnecessary if block that way. Apart from that, thank you for this issue and the patch :D
Comment #17
Jorrit commentedI agree with @Triqueon. I have updated the patch with this suggestion and some other improvements.
Comment #19
arnested commentedI committed the patch from #17 and released version 7.x-2.6.
Comment #20
Jorrit commentedThanks!