{"record":{"id":"7570d332cd4efada","repo":"caddyserver/caddy","slug":"invalid-filename-for-log-file-v","errorCode":null,"errorMessage":"invalid filename for log file: %v","messagePattern":"invalid filename for log file: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/logging/filewriter.go","lineNumber":166,"sourceCode":"\t// <format> must be a Go time compatible format, see https://pkg.go.dev/time#pkg-constants\n\tBackupTimeFormat string `json:\"backup_time_format,omitempty\"`\n}\n\n// CaddyModule returns the Caddy module information.\nfunc (FileWriter) CaddyModule() caddy.ModuleInfo {\n\treturn caddy.ModuleInfo{\n\t\tID:  \"caddy.logging.writers.file\",\n\t\tNew: func() caddy.Module { return new(FileWriter) },\n\t}\n}\n\n// Provision sets up the module\nfunc (fw *FileWriter) Provision(ctx caddy.Context) error {\n\t// Replace placeholder in filename\n\trepl := caddy.NewReplacer()\n\tfilename, err := repl.ReplaceOrErr(fw.Filename, true, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid filename for log file: %v\", err)\n\t}\n\n\tfw.Filename = filename\n\treturn nil\n}\n\nfunc (fw FileWriter) String() string {\n\tfpath, err := caddy.FastAbs(fw.Filename)\n\tif err == nil {\n\t\treturn fpath\n\t}\n\treturn fw.Filename\n}\n\n// WriterKey returns a unique key representing this fw.\nfunc (fw FileWriter) WriterKey() string {\n\treturn \"file:\" + fw.Filename\n}","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/logging/filewriter.go#L148-L184","documentation":"Error \"invalid filename for log file: %v\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/logging/filewriter.go:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid, writable file path for the log file; the wrapped error explains why the name is invalid."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}