{"record":{"id":"a7542d61a604cb2a","repo":"Seldaek/monolog","slug":"unable-to-connect-to-host-port","errorCode":null,"errorMessage":"Unable to connect to {host}:{port}","messagePattern":"Unable to connect to (.+?):(.+?)","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CubeHandler.php","lineNumber":101,"sourceCode":"            throw new \\LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port);\n        }\n    }\n\n    /**\n     * Establish a connection to an http server\n     *\n     * @throws \\LogicException           when unable to connect to the socket\n     * @throws MissingExtensionException when no curl extension\n     */\n    protected function connectHttp(): void\n    {\n        if (!\\extension_loaded('curl')) {\n            throw new MissingExtensionException('The curl extension is required to use http URLs with the CubeHandler');\n        }\n\n        $httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put');\n        if (false === $httpConnection) {\n            throw new \\LogicException('Unable to connect to ' . $this->host . ':' . $this->port);\n        }\n\n        $this->httpConnection = $httpConnection;\n        curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, \"POST\");\n        curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true);\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function write(LogRecord $record): void\n    {\n        $date = $record->datetime;\n\n        $data = ['time' => $date->format('Y-m-d\\TH:i:s.uO')];\n        $context = $record->context;\n\n        if (isset($context['type'])) {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CubeHandler.php#L83-L119","documentation":"Error \"Unable to connect to {host}:{port}\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CubeHandler.php:101 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"}