It looks like Drupal automagically detects that monolog_logging implements hook_watchdog(), so it loads that module before the one it depends on. Therefore under some conditions the monolog() function is not found and fatal errors are thrown.

See bootstrap_hooks() for reference.

CommentFileSizeAuthor
#3 monolog-undefined-1997462-3.patch3.04 KBcpliakas

Comments

cpliakas’s picture

More specificall, since Drupal sets the "bootstrap" flag to 1 in the system table for monolog_logging, it is loaded in the DRUPAL_BOOTSTRAP_VARIABLES bootstrap phase whereas the monolog module is loaded in the DRUPAL_BOOTSTRAP_FULL phase. We have a few options.

  1. Set the bootstrap flag to 1 for all modules that monolog_logging depends on (monolog, composer_manager, ctools)
  2. Silently ignore any watchdog logs that are called when the monolog() function is not available.
  3. Load the modules that monolog_logging depends on (monolog, composer_manager, ctools) when the monolog() function is unavailable().
cpliakas’s picture

To simulate this error, hack core and throw a watchdog() call in drupal_bootstrap() during the DRUPAL_BOOTSTRAP_SESSION phase.

cpliakas’s picture

Status: Active » Needs review
StatusFileSize
new3.04 KB

Pushing forward with solution #3 since we probably don't want to do a full Drupal bootstrap, and if something is logged early in the bootstrap phase then we probably don't want to silently ignore it either.

The attached patch adds a partial bootstrap process that loads the minimum subsystems and modules required for Monolog logging.

cpliakas’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.