diff --git a/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php b/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php index 1ec1710..7cacc50 100644 --- a/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php +++ b/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php @@ -44,7 +44,13 @@ public function get($channel) { if ($this->container) { try { $instance->setRequest($this->container->get('request')); - $instance->setCurrentUser($this->container->get('current_user')); + // Session handling is tightly coupled with user module, so only + // pass the current user to loggers if the user module actually + // exists. + // @todo Fix this in https://drupal.org/node/2272189 + if ($this->container->get('module_handler')->moduleExists('user')) { + $instance->setCurrentUser($this->container->get('current_user')); + } } catch (RuntimeException $e) { // We are not in a request context. diff --git a/core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php b/core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php index 67d178c..7976dcb 100644 --- a/core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php +++ b/core/lib/Drupal/Core/Logger/LoggerChannelFactoryInterface.php @@ -32,8 +32,6 @@ public function get($channel); * The PSR-3 logger to add. * @param int $priority * The priority of the logger being added. - * - * @see \Drupal\Core\DependencyInjection\Compiler\RegisterLoggersPass */ public function addLogger(LoggerInterface $logger, $priority = 0);