formatRecord example

return false === $this->bubble;
            }
        } finally {
            restore_error_handler();
        }

        return parent::handle($record);
    }

    private function doWrite(array|LogRecord $record): void
    {
        $recordFormatted = $this->formatRecord($record);

        set_error_handler(static fn () => null);

        try {
            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()) {
                    stream_socket_sendto($this->socket, $recordFormatted);
                }
            }
Home | Imprint | This part of the site doesn't use cookies.