mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Merge pull request #1488 from previousnext/path-sockets
Adds support for unix sockets
This commit is contained in:
@@ -28,7 +28,14 @@ class UdpSocket
|
||||
{
|
||||
$this->ip = $ip;
|
||||
$this->port = $port;
|
||||
$this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
||||
$domain = AF_INET;
|
||||
$protocol = SOL_UDP;
|
||||
// Check if we are using unix sockets.
|
||||
if ($port === 0) {
|
||||
$domain = AF_UNIX;
|
||||
$protocol = IPPROTO_IP;
|
||||
}
|
||||
$this->socket = socket_create($domain, SOCK_DGRAM, $protocol);
|
||||
}
|
||||
|
||||
public function write($line, $header = "")
|
||||
|
@@ -51,7 +51,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
$this->ident = $ident;
|
||||
$this->rfc = $rfc;
|
||||
|
||||
$this->socket = new UdpSocket($host, $port ?: 514);
|
||||
$this->socket = new UdpSocket($host, $port);
|
||||
}
|
||||
|
||||
protected function write(array $record): void
|
||||
|
Reference in New Issue
Block a user