{"record":{"id":"abb10cc9989f6b11","repo":"Seldaek/monolog","slug":"you-must-have-zend-server-installed-with-zend-moni","errorCode":null,"errorMessage":"You must have Zend Server installed with Zend Monitor enabled in order to use this handler","messagePattern":"You must have Zend Server installed with Zend Monitor enabled in order to use this handler","errorType":"exception","errorClass":"MissingExtensionException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/ZendMonitorHandler.php","lineNumber":33,"sourceCode":"use Monolog\\Formatter\\NormalizerFormatter;\nuse Monolog\\Level;\nuse Monolog\\LogRecord;\n\n/**\n * Handler sending logs to Zend Monitor\n *\n * @author  Christian Bergau <cbergau86@gmail.com>\n * @author  Jason Davis <happydude@jasondavis.net>\n */\nclass ZendMonitorHandler extends AbstractProcessingHandler\n{\n    /**\n     * @throws MissingExtensionException\n     */\n    public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true)\n    {\n        if (!\\function_exists('zend_monitor_custom_event')) {\n            throw new MissingExtensionException(\n                'You must have Zend Server installed with Zend Monitor enabled in order to use this handler'\n            );\n        }\n\n        parent::__construct($level, $bubble);\n    }\n\n    /**\n     * Translates Monolog log levels to ZendMonitor levels.\n     */\n    protected function toZendMonitorLevel(Level $level): int\n    {\n        return match ($level) {\n            Level::Debug     => \\ZEND_MONITOR_EVENT_SEVERITY_INFO,\n            Level::Info      => \\ZEND_MONITOR_EVENT_SEVERITY_INFO,\n            Level::Notice    => \\ZEND_MONITOR_EVENT_SEVERITY_INFO,\n            Level::Warning   => \\ZEND_MONITOR_EVENT_SEVERITY_WARNING,\n            Level::Error     => \\ZEND_MONITOR_EVENT_SEVERITY_ERROR,","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/ZendMonitorHandler.php#L15-L51","documentation":"Error \"You must have Zend Server installed with Zend Monitor enabled in order to use this handler\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/ZendMonitorHandler.php:33 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"}