[MonologBridge] Fix the Monlog ServerLogHandler from Hanging on Windows
This commit is contained in:
parent
76190ab8c2
commit
be60aa401f
@ -54,12 +54,12 @@ class ServerLogHandler extends AbstractHandler
|
||||
|
||||
$recordFormatted = $this->formatRecord($record);
|
||||
|
||||
if (!fwrite($this->socket, $recordFormatted)) {
|
||||
fclose($this->socket);
|
||||
if (-1 === stream_socket_sendto($this->socket, $recordFormatted)) {
|
||||
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
|
||||
|
||||
// Let's retry: the persistent connection might just be stale
|
||||
if ($this->socket = $this->createSocket()) {
|
||||
fwrite($this->socket, $recordFormatted);
|
||||
stream_socket_sendto($this->socket, $recordFormatted);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
Reference in New Issue
Block a user