Seldaek/monolog · error · MissingExtensionException

The curl extension is needed to use the LogglyHandler

Error message

The curl extension is needed to use the LogglyHandler

What it means

Error "The curl extension is needed to use the LogglyHandler" thrown in Seldaek/monolog.

Source

Thrown at src/Monolog/Handler/LogglyHandler.php:53

     *
     * @var CurlHandle[]
     */
    protected array $curlHandlers = [];

    protected string $token;

    /** @var string[] */
    protected array $tag = [];

    /**
     * @param string $token API token supplied by Loggly
     *
     * @throws MissingExtensionException If the curl extension is missing
     */
    public function __construct(string $token, int|string|Level $level = Level::Debug, bool $bubble = true)
    {
        if (!\extension_loaded('curl')) {
            throw new MissingExtensionException('The curl extension is needed to use the LogglyHandler');
        }

        $this->token = $token;

        parent::__construct($level, $bubble);
    }

    /**
     * Loads and returns the shared curl handler for the given endpoint.
     */
    protected function getCurlHandler(string $endpoint): CurlHandle
    {
        if (!\array_key_exists($endpoint, $this->curlHandlers)) {
            $this->curlHandlers[$endpoint] = $this->loadCurlHandle($endpoint);
        }

        return $this->curlHandlers[$endpoint];
    }

View on GitHub (pinned to 57eb102834)

When it happens

Trigger: Thrown at src/Monolog/Handler/LogglyHandler.php:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Seldaek/monolog@57eb102834 (2026-08-17). Data as JSON: /api/errors/53571c4a85bde9e6. Report an issue: GitHub.