{"record":{"id":"bf27a9d933f61503","repo":"fatedier/frp","slug":"invalid-log-level-optional-values-are-v","errorCode":null,"errorMessage":"invalid log level, optional values are %v","messagePattern":"invalid log level, optional values are (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/common.go","lineNumber":47,"sourceCode":"\t\tif c.TLS.KeyFile == \"\" {\n\t\t\treturn fmt.Errorf(\"tls.keyFile must be specified when tls is enabled\")\n\t\t}\n\t}\n\n\treturn ValidatePort(c.Port, \"webServer.port\")\n}\n\n// ValidatePort checks that the network port is in range\nfunc ValidatePort(port int, fieldPath string) error {\n\tif 0 <= port && port <= 65535 {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"%s: port number %d must be in the range 0..65535\", fieldPath, port)\n}\n\nfunc validateLogConfig(c *v1.LogConfig) error {\n\tif !slices.Contains(SupportedLogLevels, c.Level) {\n\t\treturn fmt.Errorf(\"invalid log level, optional values are %v\", SupportedLogLevels)\n\t}\n\treturn nil\n}\n","sourceCodeStart":29,"sourceCodeEnd":51,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/common.go#L29-L51","documentation":"log.level is not one of SupportedLogLevels (typically trace, debug, info, warn, error). validateLogConfig checks membership with slices.Contains and returns the allowed values in the message, failing before the logger is constructed.","triggerScenarios":"log.level = \"warning\" (the long form used by many other systems) instead of \"warn\"; \"fatal\"/\"panic\" (zap levels not exposed); casing like \"DEBUG\".","commonSituations":"Porting log settings from log4j/python conventions; uppercasing levels in Helm charts; typo.","solutions":["Use a value from the message's list, lowercase — commonly \"debug\", \"info\", \"warn\", \"error\", \"trace\"","Change \"warning\" to \"warn\"","Remove log.level to accept the default (info)"],"exampleFix":"# before\n[log]\nlevel = \"warning\"\n\n# after\n[log]\nlevel = \"warn\"","handlingStrategy":"validation","validationCode":"func validLogLevel(l string) bool {\n    return slices.Contains(validation.SupportedLogLevels, l)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Map external log level names (warning->warn) at the config boundary","Default to omitting log.level unless explicitly needed"],"tags":["frp","config","logging","go"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}