- First commit to issue fork.
We configured our site based on README file.
Probably after change to PHP 8 we don't see logs in watchdog anymore. So I debugged and I found that the module silently failed in MonologLoggerChannelFactory::getHandlers method in
// Nested syntax.
if (array_key_exists('handlers', $config)) {
try {
$handlers = array_map(function (array $handler): array {
return [
'name' => $handler['name'] ?? $handler,
'formatter' => $handler['formatter'] ?? NULL,
'processors' => $handler['processors'] ?? $this->container->getParameter(self::PROCESSORS_KEY),
];
}, $config['handlers']);
}
catch (\Throwable $e) {
return OptionalLogger::none();
}
}
My monolog.service.yml was:
parameters:
monolog.channel_handlers:
default:
handlers: ['drupal.dblog', 'stream']
formatter: 'minimal_line'
I should change to:
parameters:
monolog.channel_handlers:
default:
handlers:
- name: 'drupal.dblog'
formatter: 'minimal_line'
- name: 'stream'
formatter: 'minimal_line'
The previous version failed because the code expected that $handler will be array(typecast in function argument list.)
I suggest to change the example in README where it suggests how to enable drupal logging.
Needs work
2.0
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.