35 'authpriv' => LOG_AUTHPRIV,
37 'daemon' => LOG_DAEMON,
42 'syslog' => LOG_SYSLOG,
63 if (!defined(
'PHP_WINDOWS_VERSION_BUILD')) {
64 $this->facilities[
'local0'] = LOG_LOCAL0;
65 $this->facilities[
'local1'] = LOG_LOCAL1;
66 $this->facilities[
'local2'] = LOG_LOCAL2;
67 $this->facilities[
'local3'] = LOG_LOCAL3;
68 $this->facilities[
'local4'] = LOG_LOCAL4;
69 $this->facilities[
'local5'] = LOG_LOCAL5;
70 $this->facilities[
'local6'] = LOG_LOCAL6;
71 $this->facilities[
'local7'] = LOG_LOCAL7;
73 parent::__construct($options);
74 if (!openlog(
'TYPO3', (LOG_ODELAY | LOG_PID), $this->facility)) {
75 $facilityName = array_search($this->facility, $this->facilities);
76 throw new \RuntimeException(
'Could not open syslog for facility ' . $facilityName, 1321722682);
94 if (array_key_exists(strtolower(
$facility), $this->facilities)) {
95 $this->facility = $this->facilities[strtolower(
$facility)];
107 $recordData = $record->
getData();
108 if (!empty($recordData)) {
111 if (isset($recordData[
'exception']) && $recordData[
'exception'] instanceof \
Exception) {
112 $recordData[
'exception'] = (string)$recordData[
'exception'];
114 $data =
'- ' . json_encode($recordData);
117 '[request="%s" component="%s"] %s %s',
135 throw new \RuntimeException(
'Could not write log record to syslog', 1345036337);
__construct(array $options=array())
getMessageForSyslog(LogRecord $record)
writeLog(LogRecord $record)