{"record":{"id":"1a9d7af17c6c23e3","repo":"Seldaek/monolog","slug":"extra-must-be-an-array","errorCode":null,"errorMessage":"extra must be an array","messagePattern":"extra must be an array","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Monolog/LogRecord.php","lineNumber":46,"sourceCode":"\n    public function __construct(\n        public readonly \\DateTimeImmutable $datetime,\n        public readonly string $channel,\n        public readonly Level $level,\n        public readonly string $message,\n        /** @var array<mixed> */\n        public readonly array $context = [],\n        /** @var array<mixed> */\n        public array $extra = [],\n        public mixed $formatted = null,\n    ) {\n    }\n\n    public function offsetSet(mixed $offset, mixed $value): void\n    {\n        if ($offset === 'extra') {\n            if (!\\is_array($value)) {\n                throw new \\InvalidArgumentException('extra must be an array');\n            }\n\n            $this->extra = $value;\n\n            return;\n        }\n\n        if ($offset === 'formatted') {\n            $this->formatted = $value;\n\n            return;\n        }\n\n        throw new \\LogicException('Unsupported operation: setting '.$offset);\n    }\n\n    public function offsetExists(mixed $offset): bool\n    {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/LogRecord.php#L28-L64","documentation":"Error \"extra must be an array\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/LogRecord.php:46 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"}