{"record":{"id":"bfc14b5b55679bd5","repo":"Seldaek/monolog","slug":"the-sockets-extension-is-required-to-use-udp-urls","errorCode":null,"errorMessage":"The sockets extension is required to use udp URLs with the CubeHandler","messagePattern":"The sockets extension is required to use udp URLs with the CubeHandler","errorType":"exception","errorClass":"MissingExtensionException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/CubeHandler.php","lineNumber":73,"sourceCode":"        }\n\n        $this->scheme = $urlInfo['scheme'];\n        $this->host = $urlInfo['host'];\n        $this->port = $urlInfo['port'];\n\n        parent::__construct($level, $bubble);\n    }\n\n    /**\n     * Establish a connection to an UDP socket\n     *\n     * @throws \\LogicException           when unable to connect to the socket\n     * @throws MissingExtensionException when there is no socket extension\n     */\n    protected function connectUdp(): void\n    {\n        if (!\\extension_loaded('sockets')) {\n            throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler');\n        }\n\n        $udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0);\n        if (false === $udpConnection) {\n            throw new \\LogicException('Unable to create a socket');\n        }\n\n        $this->udpConnection = $udpConnection;\n        if (!socket_connect($this->udpConnection, $this->host, $this->port)) {\n            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","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/CubeHandler.php#L55-L91","documentation":"Error \"The sockets extension is required to use udp URLs with the CubeHandler\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/CubeHandler.php:73 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"}