37 $this->socket =
new UdpSocket($host, $port ?: 514);
40 protected function write(array $record)
46 foreach ($lines as $line) {
47 $this->socket->write($line,
$header);
53 $this->socket->close();
58 if (is_array($message)) {
59 $message = implode(
"\n", $message);
62 return preg_split(
'/$\R?^/m', $message);
72 return "<$priority>1 ";
An exception for terminatinating execution or to throw for unit testing.
Common syslog functionality.
A Handler for logging to a remote syslogd server.
splitMessageIntoLines($message)
__construct($host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true)
makeCommonSyslogHeader($severity)
Make common syslog header (see rfc5424)
setSocket($socket)
Inject your own socket, mainly used for testing.
close()
Closes the handler.
write(array $record)
Writes the record down to the log of the implementing handler.
const DEBUG
Detailed debug information.