{"record":{"id":"97cb548b1115ba4e","repo":"crowdsecurity/crowdsec","slug":"unknown-level-s-w-97cb54","errorCode":null,"errorMessage":"unknown level %s: %w","messagePattern":"unknown level (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/config.go","lineNumber":252,"sourceCode":"\tif containerNameOrID == \"\" {\n\t\treturn fmt.Errorf(\"empty %s DSN\", d.GetName()+\"://\")\n\t}\n\n\td.Config.ContainerName = append(d.Config.ContainerName, containerNameOrID)\n\t// we add it as an ID also so user can provide docker name or docker ID\n\td.Config.ContainerID = append(d.Config.ContainerID, containerNameOrID)\n\n\tparameters := parsedURL.Query()\n\n\tfor k, v := range parameters {\n\t\tswitch k {\n\t\tcase \"log_level\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'log_level' parameters is required, not many\")\n\t\t\t}\n\t\t\tlvl, err := log.ParseLevel(v[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unknown level %s: %w\", v[0], err)\n\t\t\t}\n\t\t\td.logger.Logger.SetLevel(lvl)\n\t\tcase \"until\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'until' parameters is required, not many\")\n\t\t\t}\n\t\t\td.containerLogsOptions.Until = v[0]\n\t\tcase \"since\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'since' parameters is required, not many\")\n\t\t\t}\n\t\t\td.containerLogsOptions.Since = v[0]\n\t\tcase \"follow_stdout\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'follow_stdout' parameters is required, not many\")\n\t\t\t}\n\t\t\tfollowStdout, err := strconv.ParseBool(v[0])\n\t\t\tif err != nil {","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/config.go#L234-L270","documentation":"The `log_level` DSN parameter is parsed with log.ParseLevel (logrus). If the value is not one of the recognized levels (panic, fatal, error, warn/warning, info, debug, trace), configuration fails with this wrapped error.","triggerScenarios":"ConfigureByDSN encountering `?log_level=<value>` where log.ParseLevel(v[0]) fails — e.g. log_level=verbose, LOG (uppercase handled? no, ParseLevel is case-insensitive but misspellings are not), or a numeric level like 3.","commonSituations":"Users writing numeric syslog-style levels (0-7) or names like `verbose`/`warn_` in the DSN; copy-pasted log level from a different logging library with different level names.","solutions":["Use a logrus level name: panic, fatal, error, warn, info, debug, or trace.","Replace numeric levels with the matching name (e.g. 3 -> error).","Check for typos/extra characters in the parameter value."],"exampleFix":"// before\ndocker://mycontainer?log_level=3\n// after\ndocker://mycontainer?log_level=error","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"panic\":true,\"fatal\":true,\"error\":true,\"warn\":true,\"warning\":true,\"info\":true,\"debug\":true,\"trace\":true}\nif lvl := dsnQuery.Get(\"log_level\"); lvl != \"\" && !allowed[strings.ToLower(lvl)] {\n    return fmt.Errorf(\"log_level %q not a logrus level\", lvl)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only logrus level names (panic..trace), not numeric or foreign-library names.","Keep DSN parameter values lowercase and typo-free.","Test the full DSN with cscli/one-shot acquisition before production."],"tags":["config","logging","dsn"],"backgroundTag":"invalid-enum-value","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}