2 namespace TYPO3\CMS\Core\Log\Writer;
31 'authpriv' => LOG_AUTHPRIV,
33 'daemon' => LOG_DAEMON,
38 'syslog' => LOG_SYSLOG,
60 if (!defined(
'PHP_WINDOWS_VERSION_BUILD')) {
61 $this->facilities[
'local0'] = LOG_LOCAL0;
62 $this->facilities[
'local1'] = LOG_LOCAL1;
63 $this->facilities[
'local2'] = LOG_LOCAL2;
64 $this->facilities[
'local3'] = LOG_LOCAL3;
65 $this->facilities[
'local4'] = LOG_LOCAL4;
66 $this->facilities[
'local5'] = LOG_LOCAL5;
67 $this->facilities[
'local6'] = LOG_LOCAL6;
68 $this->facilities[
'local7'] = LOG_LOCAL7;
70 parent::__construct($options);
71 if (!openlog(
'TYPO3', (LOG_ODELAY | LOG_PID), $this->facility)) {
72 $facilityName = array_search($this->facility, $this->facilities);
73 throw new \RuntimeException(
'Could not open syslog for facility ' . $facilityName, 1321722682);
93 if (array_key_exists(strtolower(
$facility), $this->facilities)) {
94 $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',
136 throw new \RuntimeException(
'Could not write log record to syslog', 1345036337);