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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danilo_formagio created an issue. See original summary.

leotorati’s picture

Assigned: Unassigned » leotorati
leotorati’s picture

I confirmed the issue and I agree the proposed solution.

Kenedy Maneiro’s picture

Work fine for me

leotorati’s picture

Assigned: leotorati » Unassigned
Status: Active » Reviewed & tested by the community

geek-merlin’s picture

Status: Reviewed & tested by the community » Fixed

Yes, 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.

geek-merlin’s picture

Yes, 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.

danilo_formagio’s picture

Thanks @axel.rutz!
We are using to update watchdog log message to add the severity at the beginning.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.