{"record":{"id":"7adb47b523734508","repo":"Seldaek/monolog","slug":"invalid-filename-format-format-must-contain-at-l","errorCode":null,"errorMessage":"Invalid filename format - format must contain at least `{date}`, because otherwise rotating is impossible.","messagePattern":"Invalid filename format - format must contain at least `(.+?)`, because otherwise rotating is impossible\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/RotatingFileHandler.php","lineNumber":87,"sourceCode":"        }\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function reset(): void\n    {\n        parent::reset();\n    }\n\n    /**\n     * @return $this\n     */\n    public function setFilenameFormat(string $filenameFormat, string $dateFormat): self\n    {\n        $this->setDateFormat($dateFormat);\n        if (substr_count($filenameFormat, '{date}') === 0) {\n            throw new InvalidArgumentException(\n                'Invalid filename format - format must contain at least `{date}`, because otherwise rotating is impossible.'\n            );\n        }\n        $this->filenameFormat = $filenameFormat;\n        $this->url = $this->getTimedFilename();\n        $this->close();\n\n        return $this;\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function write(LogRecord $record): void\n    {\n        // on the first record written, if the log is new, we rotate (once per day) after the log has been written so that the new file exists\n        if (null === $this->mustRotate) {\n            $this->mustRotate = null === $this->url || !file_exists($this->url);","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/RotatingFileHandler.php#L69-L105","documentation":"Error \"Invalid filename format - format must contain at least `{date}`, because otherwise rotating is impossible.\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/RotatingFileHandler.php:87 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"}