コード例 #1
0
 /**
  * Constructor, opens the log file handle
  *
  * @param array $options
  * @return FileWriter
  */
 public function __construct(array $options = array())
 {
     // the parent constructor reads $options and sets them
     parent::__construct($options);
     if (empty($options['logFile'])) {
         $this->setLogFile($this->defaultLogFile);
     }
 }
コード例 #2
0
ファイル: SyslogWriter.php プロジェクト: khanhdeux/typo3test
 /**
  * Constructor, adds facilities on *nix environments.
  *
  * @param array $options Configuration options
  * @throws \RuntimeException if connection to syslog cannot be opened
  * @see \TYPO3\CMS\Core\Log\Writer\AbstractWriter
  */
 public function __construct(array $options = array())
 {
     // additional facilities for *nix environments
     if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
         $this->facilities['local0'] = LOG_LOCAL0;
         $this->facilities['local1'] = LOG_LOCAL1;
         $this->facilities['local2'] = LOG_LOCAL2;
         $this->facilities['local3'] = LOG_LOCAL3;
         $this->facilities['local4'] = LOG_LOCAL4;
         $this->facilities['local5'] = LOG_LOCAL5;
         $this->facilities['local6'] = LOG_LOCAL6;
         $this->facilities['local7'] = LOG_LOCAL7;
     }
     parent::__construct($options);
     if (!openlog('TYPO3', LOG_ODELAY | LOG_PID, $this->facility)) {
         $facilityName = array_search($this->facility, $this->facilities);
         throw new \RuntimeException('Could not open syslog for facility ' . $facilityName, 1321722682);
     }
 }