{"record":{"id":"f1cce75492215db3","repo":"Seldaek/monolog","slug":"elasticahandler-is-only-compatible-with-elasticafo","errorCode":null,"errorMessage":"ElasticaHandler is only compatible with ElasticaFormatter","messagePattern":"ElasticaHandler is only compatible with ElasticaFormatter","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/ElasticaHandler.php","lineNumber":96,"sourceCode":"\n    /**\n     * @inheritDoc\n     */\n    protected function write(LogRecord $record): void\n    {\n        $this->bulkSend([$record->formatted]);\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function setFormatter(FormatterInterface $formatter): HandlerInterface\n    {\n        if ($formatter instanceof ElasticaFormatter) {\n            return parent::setFormatter($formatter);\n        }\n\n        throw new \\InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter');\n    }\n\n    /**\n     * @return mixed[]\n     *\n     * @phpstan-return Options\n     */\n    public function getOptions(): array\n    {\n        return $this->options;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function getDefaultFormatter(): FormatterInterface\n    {\n        return new ElasticaFormatter($this->options['index'], $this->options['type']);","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/ElasticaHandler.php#L78-L114","documentation":"Error \"ElasticaHandler is only compatible with ElasticaFormatter\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/ElasticaHandler.php:96 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"}