{"record":{"id":"c30b13ee59f4b0a0","repo":"Seldaek/monolog","slug":"level-is-expected-to-be-a-string-int-or-insta","errorCode":null,"errorMessage":"$level is expected to be a string, int or {} instance","messagePattern":"\\$level is expected to be a string, int or (.+?) instance","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Logger.php","lineNumber":571,"sourceCode":"        return $this->exceptionHandler;\n    }\n\n    /**\n     * Adds a log record at an arbitrary level.\n     *\n     * This method allows for compatibility with common interfaces.\n     *\n     * @param mixed             $level   The log level (a Monolog, PSR-3 or RFC 5424 level)\n     * @param string|Stringable $message The log message\n     * @param mixed[]           $context The log context\n     *\n     * @phpstan-param Level|LogLevel::* $level\n     */\n    public function log($level, string|\\Stringable $message, array $context = []): void\n    {\n        if (!$level instanceof Level) {\n            if (!\\is_string($level) && !\\is_int($level)) {\n                throw new \\InvalidArgumentException('$level is expected to be a string, int or '.Level::class.' instance');\n            }\n\n            if (isset(self::RFC_5424_LEVELS[$level])) {\n                $level = self::RFC_5424_LEVELS[$level];\n            }\n\n            $level = static::toMonologLevel($level);\n        }\n\n        $this->addRecord($level, (string) $message, $context);\n    }\n\n    /**\n     * Adds a log record at the DEBUG level.\n     *\n     * This method allows for compatibility with common interfaces.\n     *\n     * @param string|Stringable $message The log message","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Logger.php#L553-L589","documentation":"Error \"$level is expected to be a string, int or {} instance\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Logger.php:571 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"}