Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I noticed that after some time Drupal stops logging messages on watchdog.
Debugging the code I noticed that the variable $original_implementations is always empty when this issue happens, so watchdog is not called.
$original_implementations = &drupal_static('watchdogalter_original_implementations', array());
foreach (array_keys($original_implementations) as $module) {
module_invoke($module, 'watchdog', $log_entry);
}
Proposed resolution
I suggest to use variable_set and variable_get for 'watchdogalter_original_implementations' instead of drupal_static.
variable_set and variable_get are cached and it should not affect the performance.
Comment | File | Size | Author |
---|---|---|---|
watchdogalter_breaking-logs_1.patch | 1.35 KB | danilo_formagio |
Comments
Comment #2
leotorati CreditAttribution: leotorati at CI&T commentedComment #3
leotorati CreditAttribution: leotorati at CI&T commentedI confirmed the issue and I agree the proposed solution.
Comment #4
Kenedy Maneiro CreditAttribution: Kenedy Maneiro commentedWork fine for me
Comment #5
leotorati CreditAttribution: leotorati at CI&T commentedComment #7
geek-merlinYes, that's far more robust. Committed and fixed.
Added new release.
Thank ya all!
Just for interest: You're all the same company, how does it use the module?
Pro tip: Patches rolled with git fp carry authorship and save me one command.
Comment #8
geek-merlinYes, that's far more robust. Committed and fixed.
Added new release.
Added new status variable to MM Features Banish
Thank ya all!
Just for interest: You're all the same company, how does it use the module?
Pro tip: Patches rolled with git fp carry authorship and save me one command.
Comment #9
danilo_formagio CreditAttribution: danilo_formagio at CI&T commentedThanks @axel.rutz!
We are using to update watchdog log message to add the severity at the beginning.