diff --git a/src/DI/MonologExtension.php b/src/DI/MonologExtension.php index 9f518b0..ef92022 100644 --- a/src/DI/MonologExtension.php +++ b/src/DI/MonologExtension.php @@ -113,10 +113,8 @@ protected function loadHandlers(array $config): void $builder = $this->getContainerBuilder(); foreach ($config['handlers'] as $handlerName => $implementation) { - - $builder->addDefinition($this->prefix('handler.' . $handlerName)) - ->setFactory($implementation) - ->setAutowired(FALSE) + $serviceName = $this->loadDefinitions($builder, $handlerName, $implementation); + $builder->getDefinition($serviceName) ->addTag(self::TAG_HANDLER) ->addTag(self::TAG_PRIORITY, is_numeric($handlerName) ? $handlerName : 0); }