‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Log\Writer\SyslogWriter Class Reference
Inheritance diagram for TYPO3\CMS\Core\Log\Writer\SyslogWriter:
TYPO3\CMS\Core\Log\Writer\AbstractWriter TYPO3\CMS\Core\Log\Writer\WriterInterface

Public Member Functions

if(!openlog('TYPO3', LOG_ODELAY|LOG_PID, $this->facility)) __destruct ()
 
 setFacility ($facility)
 
 getMessageForSyslog (LogRecord $record)
 
TYPO3 CMS Core Log Writer WriterInterface writeLog (LogRecord $record)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Log\Writer\AbstractWriter
 __construct (array $options=[])
 

Public Attributes

$this facilities ['local1'] = LOG_LOCAL1
 

Private Attributes

array< string, $facilities=array('auth'=> LOG_AUTH, 'authpriv'=> LOG_AUTHPRIV, 'cron'=> LOG_CRON, 'daemon'=> LOG_DAEMON, 'kern'=> LOG_KERN, 'lpr'=> LOG_LPR, 'mail'=> LOG_MAIL, 'news'=> LOG_NEWS, 'syslog'=> LOG_SYSLOG, 'user'=> LOG_USER, 'uucp'=> LOG_UUCP,);protected int $facility=LOG_USER;public function __construct(array $options=[]) { if(!defined( 'PHP_WINDOWS_VERSION_BUILD')) { $this-> facilities ['local0'] = LOG_LOCAL0
 

Additional Inherited Members

- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Log\Writer\AbstractWriter
 interpolate (string $message, array $context=[])
 
 formatContextValue (string $value)
 
 formatException (\Throwable $ex)
 

Detailed Description

Log writer that writes to syslog

Definition at line 24 of file SyslogWriter.php.

Constructor & Destructor Documentation

◆ __destruct()

if (!openlog( 'TYPO3', LOG_ODELAY|LOG_PID, $this->facility)) TYPO3\CMS\Core\Log\Writer\SyslogWriter::__destruct ( )

Destructor, closes connection to syslog.

Definition at line 81 of file SyslogWriter.php.

Member Function Documentation

◆ getMessageForSyslog()

TYPO3\CMS\Core\Log\Writer\SyslogWriter::getMessageForSyslog ( LogRecord  $record)

Returns the data of the record in syslog format

Definition at line 101 of file SyslogWriter.php.

References TYPO3\CMS\Webhooks\Message\$record, and TYPO3\CMS\Core\Log\Writer\AbstractWriter\formatException().

◆ setFacility()

TYPO3\CMS\Core\Log\Writer\SyslogWriter::setFacility (   $facility)

Sets the facility to use when logging to syslog.

Parameters
string$facility‪Facility to use when logging.

Definition at line 91 of file SyslogWriter.php.

References TYPO3\CMS\Core\Log\Writer\SyslogWriter\facilities.

◆ writeLog()

TYPO3 CMS Core Log Writer WriterInterface TYPO3\CMS\Core\Log\Writer\SyslogWriter::writeLog ( LogRecord  $record)

Writes the log record to syslog

Parameters
LogRecord$recordLog record
Returns
‪\TYPO3\CMS\Core\Log\Writer\WriterInterface
Exceptions

Implements TYPO3\CMS\Core\Log\Writer\WriterInterface.

Definition at line 131 of file SyslogWriter.php.

References TYPO3\CMS\Webhooks\Message\$record, and TYPO3\CMS\Core\Log\LogLevel\normalizeLevel().

Member Data Documentation

◆ facilities [1/2]

$this TYPO3\CMS\Core\Log\Writer\SyslogWriter::facilities = LOG_LOCAL0
private

List of valid syslog facility names. private as it's not supposed to be changed.

int> Facilities

Definition at line 62 of file SyslogWriter.php.

Referenced by TYPO3\CMS\Core\Log\Writer\SyslogWriter\setFacility().

◆ facilities [2/2]

$this TYPO3\CMS\Core\Log\Writer\SyslogWriter::facilities[ 'local7'] = LOG_LOCAL1

Definition at line 63 of file SyslogWriter.php.