TYPO3  7.6
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SyslogWriter Class Reference
Inheritance diagram for SyslogWriter:
AbstractWriter WriterInterface

Public Member Functions

 __construct (array $options=array())
 
 __destruct ()
 
 setFacility ($facility)
 
 getMessageForSyslog (LogRecord $record)
 
 writeLog (LogRecord $record)
 
- Public Member Functions inherited from AbstractWriter
 __construct (array $options=array())
 
- Public Member Functions inherited from WriterInterface
 writeLog (\TYPO3\CMS\Core\Log\LogRecord $record)
 

Protected Attributes

 $facility = LOG_USER
 

Private Attributes

 $facilities
 

Detailed Description

Log writer that writes to syslog

Definition at line 21 of file SyslogWriter.php.

Constructor & Destructor Documentation

__construct ( array  $options = array())

Constructor, adds facilities on *nix environments.

Parameters
array$optionsConfiguration options
Exceptions
\RuntimeExceptionif connection to syslog cannot be opened
See Also

Definition at line 57 of file SyslogWriter.php.

__destruct ( )

Destructor, closes connection to syslog.

Definition at line 80 of file SyslogWriter.php.

Member Function Documentation

getMessageForSyslog ( LogRecord  $record)

Returns the data of the record in syslog format

Parameters
LogRecord$record
Returns
string

Definition at line 104 of file SyslogWriter.php.

References LogRecord\getComponent(), LogRecord\getData(), LogRecord\getMessage(), and LogRecord\getRequestId().

Referenced by SyslogWriter\writeLog().

setFacility (   $facility)

Sets the facility to use when logging to syslog.

Parameters
int$facilityFacility to use when logging.
Returns
void

Definition at line 91 of file SyslogWriter.php.

References SyslogWriter\$facility.

writeLog ( LogRecord  $record)

Writes the log record to syslog

Parameters
LogRecord$recordLog record
Returns
Exceptions
\RuntimeException

Definition at line 133 of file SyslogWriter.php.

References LogRecord\getLevel(), and SyslogWriter\getMessageForSyslog().

Member Data Documentation

$facilities
private
Initial value:
= 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
)

Definition at line 29 of file SyslogWriter.php.

$facility = LOG_USER
protected

Definition at line 48 of file SyslogWriter.php.

Referenced by SyslogWriter\setFacility().