41 $this->socket =
new UdpSocket($host, $port ?: 514);
44 protected function write(array $record)
50 foreach ($lines as $line) {
51 $this->socket->write($line,
$header);
57 $this->socket->close();
66 return preg_split(
'/$\R?^/m',
$message, -1, PREG_SPLIT_NO_EMPTY);
76 if (!$pid = getmypid()) {
80 if (!$hostname = gethostname()) {
84 return "<$priority>1 " .
93 return date(\DateTime::RFC3339);
const DEBUG
Detailed debug information.
makeCommonSyslogHeader($severity)
Make common syslog header (see rfc5424)
A Handler for logging to a remote syslogd server.
catch(Exception $e) $message
setSocket($socket)
Inject your own socket, mainly used for testing.
__construct($host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true, $ident='php')
splitMessageIntoLines($message)
Common syslog functionality.