35 $this->socket =
new UdpSocket($host, $port ?: 514);
38 protected function write(array $record)
44 foreach ($lines as $line) {
45 $this->socket->write($line,
$header);
51 $this->socket->close();
56 if (is_array($message)) {
57 $message = implode(
"\n", $message);
60 return preg_split(
'/$\R?^/m', $message);
70 return "<$priority>1 ";
78 $this->socket = $socket;
const DEBUG
Detailed debug information.
makeCommonSyslogHeader($severity)
Make common syslog header (see rfc5424)
A Handler for logging to a remote syslogd server.
setSocket($socket)
Inject your own socket, mainly used for testing.
splitMessageIntoLines($message)
Common syslog functionality.
__construct($host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true)