public function testInvalidAppenderInLogger()
 {
     $this->setExpectedException(LoggerException::class);
     $hierarchy = new LoggerHierarchy();
     $configurator = new LoggerConfigurator();
     $configurator->configure($hierarchy, ['loggers' => ['logger' => ['appenders' => [new stdClass()], 'addictive' => false]]]);
 }
 public function configure(\Mougrim\Logger\LoggerHierarchy $hierarchy, array $config)
 {
     try {
         parent::configure($hierarchy, $config);
     } catch (\Mougrim\Logger\LoggerConfigurationException $exception) {
         throw new LoggerConfigurationException($exception->getMessage(), $exception->getCode(), $exception);
     }
 }
Пример #3
0
 /**
  * @param null $configuration
  */
 public static function configure($configuration = null)
 {
     static::reset();
     if (is_string($configuration) && is_file($configuration)) {
         if (preg_match('/\\.php$/', $configuration)) {
             /** @noinspection PhpIncludeInspection */
             $configuration = (require $configuration);
         }
     }
     if (is_array($configuration)) {
         $configurator = new LoggerConfigurator();
         $configurator->configure(self::$hierarchy, $configuration);
     }
     self::$isConfigured = true;
 }