Constructor of \Drupal\syslog\Logger\SysLog uses ConfigFactory instead of ConfigFactoryInterface as first argument. This is not good and should be changed to use the interface.

WebProfiler will send in a ConfigFactoryInterface and will fail with the following message:

Recoverable fatal error: Argument 1 passed to Drupal\syslog\Logger\SysLog::__construct() must be an instance of Drupal\Core\Config\ConfigFactory, instance of Drupal\webprofiler\Config\ConfigFactoryWrapper given, called in C:\git\web\files\php\service_container\service_container_prod\6245d249e2f5a37af3c2b392113af3de2f37541dc84154e0669b53f09f771778.php on line 4502 and defined in Drupal\syslog\Logger\SysLog->__construct() (line 50 of core\modules\syslog\src\Logger\SysLog.php).
Drupal\syslog\Logger\SysLog->__construct(Object, Object)
Drupal\Core\DependencyInjection\Container\prod\service_container_prod->getLogger_SyslogService()
Symfony\Component\DependencyInjection\Container->get('logger.syslog')
Drupal\Core\DependencyInjection\Container\prod\service_container_prod->getLogger_FactoryService()
Symfony\Component\DependencyInjection\Container->get('logger.factory')
Drupal\Core\DependencyInjection\Container\prod\service_container_prod->getLogger_Channel_WebprofilerService()
Symfony\Component\DependencyInjection\Container->get('logger.channel.webprofiler')
Drupal\Core\DependencyInjection\Container\prod\service_container_prod->getProfilerService()
Symfony\Component\DependencyInjection\Container->get('profiler')
Drupal\Core\DependencyInjection\Container\prod\service_container_prod->getWebprofiler_ProfilerlistenerService()
Symfony\Component\DependencyInjection\Container->get('webprofiler.profilerlistener')
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners('kernel.request')
Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess('kernel.request')
Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.request', Object)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Symfony_Component_HttpKernel_HttpKernel_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_Session_Proxy->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\Core\DependencyInjection\Container\prod\Drupal_Core_StackMiddleware_KernelPreHandle_Proxy->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\devel\StackMiddleware\DevelMiddleware->handle(Object, 1, 1)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
CommentFileSizeAuthor
#1 syslog_is_incompatible-2498269-1.patch1.18 KBwillzyx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

willzyx’s picture

Version: 8.0.0-beta11 » 8.0.x-dev
Priority: Major » Normal
Status: Active » Needs review
FileSize
1.18 KB

yes this should be changed to use the interface (see also Drupal Object-oriented code)

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Awesome. This is a bug without disruption, so this is in the hope that no elaborate beta evaluation is needed.

dawehner’s picture

Issue tags: +Quickfix

+1 In an ideal world we would have automatic code review tools which finds those problems

hnygard’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 767aa76 and pushed to 8.0.x. Thanks!

  • alexpott committed 767aa76 on 8.0.x
    Issue #2498269 by willzyx: Syslog is incompatible with Webprofiler -...

Status: Fixed » Closed (fixed)

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