protected function createLogger($channel, $loggerId, ContainerBuilder $container)
 {
     if (!in_array($channel, $this->channels)) {
         $logger = new DefinitionDecorator('monolog.logger_prototype');
         $logger->setArgument(0, $channel);
         $container->setDefinition($loggerId, $logger);
         array_push($this->channels, $channel);
     }
 }
Ejemplo n.º 2
0
 protected function createListener($container, $id, $config, $userProvider)
 {
     $listenerId = $this->getListenerId();
     $listener = new DefinitionDecorator($listenerId);
     $listener->setArgument(3, $id);
     $listener->setArgument(4, array_intersect_key($config, $this->options));
     // success handler
     if (isset($config['success_handler'])) {
         $listener->setArgument(5, new Reference($config['success_handler']));
     }
     // failure handler
     if (isset($config['failure_handler'])) {
         $listener->setArgument(6, new Reference($config['failure_handler']));
     }
     $listenerId .= '.' . $id;
     $container->setDefinition($listenerId, $listener);
     return $listenerId;
 }
 protected function createListener($container, $id, $config, $userProvider)
 {
     // merge set options with default options
     $options = $this->getOptionsFromConfig($config);
     $listenerId = $this->getListenerId();
     $listener = new DefinitionDecorator($listenerId);
     $listener->setArgument(3, $id);
     $listener->setArgument(4, $options);
     // success handler
     if (isset($config['success_handler'])) {
         $listener->setArgument(5, new Reference($config['success_handler']));
     }
     // failure handler
     if (isset($config['failure_handler'])) {
         $listener->setArgument(6, new Reference($config['failure_handler']));
     }
     $listenerId .= '.' . $id;
     $container->setDefinition($listenerId, $listener);
     return $listenerId;
 }