{"record":{"id":"2916e507b907b970","repo":"Seldaek/monolog","slug":"write-timed-out","errorCode":null,"errorMessage":"Write timed-out","messagePattern":"Write timed-out","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/SocketHandler.php","lineNumber":400,"sourceCode":"\n    private function writeToSocket(string $data): void\n    {\n        $length = \\strlen($data);\n        $sent = 0;\n        $this->lastSentBytes = $sent;\n        while ($this->isConnected() && $sent < $length) {\n            if (0 === $sent) {\n                $chunk = $this->fwrite($data);\n            } else {\n                $chunk = $this->fwrite(substr($data, $sent));\n            }\n            if ($chunk === false) {\n                throw new \\RuntimeException(\"Could not write to socket\");\n            }\n            $sent += $chunk;\n            $socketInfo = $this->streamGetMetadata();\n            if (\\is_array($socketInfo) && (bool) $socketInfo['timed_out']) {\n                throw new \\RuntimeException(\"Write timed-out\");\n            }\n\n            if ($this->writingIsTimedOut($sent)) {\n                throw new \\RuntimeException(\"Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)\");\n            }\n        }\n        if (!$this->isConnected() && $sent < $length) {\n            throw new \\RuntimeException(\"End-of-file reached, probably we got disconnected (sent $sent of $length)\");\n        }\n    }\n\n    private function writingIsTimedOut(int $sent): bool\n    {\n        // convert to ms\n        if (0.0 === $this->writingTimeout) {\n            return false;\n        }\n","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/SocketHandler.php#L382-L418","documentation":"Error \"Write timed-out\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/SocketHandler.php:400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}