[MonologBridge] Fix the Monlog ServerLogHandler from Hanging on Windows

This commit is contained in:
Chad Sikorra 2017-05-19 13:02:26 -05:00 committed by Fabien Potencier
parent 76190ab8c2
commit be60aa401f

View File

@ -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 {