{"record":{"id":"922db524b654b353","repo":"Seldaek/monolog","slug":"no-udp-socket-could-be-opened","errorCode":null,"errorMessage":"No UDP socket could be opened","messagePattern":"No UDP socket could be opened","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CubeHandler.php","lineNumber":143,"sourceCode":"\n        $data['data'] = $context;\n        $data['data']['level'] = $record->level;\n\n        if ($this->scheme === 'http') {\n            $this->writeHttp(Utils::jsonEncode($data));\n        } else {\n            $this->writeUdp(Utils::jsonEncode($data));\n        }\n    }\n\n    private function writeUdp(string $data): void\n    {\n        if (null === $this->udpConnection) {\n            $this->connectUdp();\n        }\n\n        if (null === $this->udpConnection) {\n            throw new \\LogicException('No UDP socket could be opened');\n        }\n\n        socket_send($this->udpConnection, $data, \\strlen($data), 0);\n    }\n\n    private function writeHttp(string $data): void\n    {\n        if (null === $this->httpConnection) {\n            $this->connectHttp();\n        }\n\n        if (null === $this->httpConnection) {\n            throw new \\LogicException('No connection could be established');\n        }\n\n        curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');\n        curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, [\n            'Content-Type: application/json',","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CubeHandler.php#L125-L161","documentation":"Error \"No UDP socket could be opened\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CubeHandler.php:143 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"}