/**
  * initializes the layout using the configuration.
  * @param Configuration $config the configuration for this layout.
  * @see PHPLog\LayoutAbstract::init()
  */
 public function init(Configuration $config)
 {
     if (!isset($config->pattern)) {
         $config->pattern = $this->pattern;
     }
     parent::init($config);
     $this->fileLocation = $config->get('file', '');
     $this->dateFormat = $config->get('dateFormat', $this->dateFormat);
 }
Exemple #2
0
 /**
  * initializes the layout using the configuration.
  * @param Configuration $config the configuration for this layout.
  * @see PHPLog\LayoutAbstract::init()
  */
 public function init(Configuration $config)
 {
     parent::init($config);
     $this->delimiter = $config->get('delimiter', $this->delimiter);
     if ($this->delimiter == $this->getIdentifier()) {
         throw new \Exception('identifier cannot match delimiter');
     }
     if (!isset($config->pattern)) {
         throw new \Exception('a pattern must be defined');
     }
     $this->pattern = $config->pattern;
     $this->keys = $this->parseValueNames();
 }