{"record":{"id":"401916dd9d417dc1","repo":"crowdsecurity/crowdsec","slug":"invalid-log-level-in-dsn-w-401916","errorCode":null,"errorMessage":"invalid log_level in dsn: %w","messagePattern":"invalid log_level in dsn: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/victorialogs/config.go","lineNumber":188,"sourceCode":"\n\t\ts.Config.MaxFailureDuration = duration\n\t} else {\n\t\ts.Config.MaxFailureDuration = 5 * time.Second // for OneShot mode it doesn't make sense to have longer duration\n\t}\n\n\tif limit := params.Get(\"limit\"); limit != \"\" {\n\t\tlimit, err := strconv.Atoi(limit)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid limit in dsn: %w\", err)\n\t\t}\n\n\t\ts.Config.Limit = limit\n\t}\n\n\tif logLevel := params.Get(\"log_level\"); logLevel != \"\" {\n\t\tlevel, err := log.ParseLevel(logLevel)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid log_level in dsn: %w\", err)\n\t\t}\n\n\t\ts.Config.LogLevel = level\n\t\ts.logger.Logger.SetLevel(level)\n\t}\n\n\ts.Config.URL = fmt.Sprintf(\"%s://%s\", scheme, u.Host)\n\tif u.User != nil {\n\t\ts.Config.Auth.Username = u.User.Username()\n\t\ts.Config.Auth.Password, _ = u.User.Password()\n\t}\n\n\tclientConfig := vlclient.Config{\n\t\tURL:      s.Config.URL,\n\t\tHeaders:  s.Config.Headers,\n\t\tLimit:    s.Config.Limit,\n\t\tQuery:    s.Config.Query,\n\t\tSince:    s.Config.Since,","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/victorialogs/config.go#L170-L206","documentation":"ConfigureByDSN parses the optional `log_level` DSN parameter with log.ParseLevel (logrus). The value must be one of the accepted level names (panic, fatal, error, warn, info, debug, trace); anything else is wrapped with \"invalid log_level in dsn\".","triggerScenarios":"Providing `log_level=` in the DSN with an unrecognized level name, e.g. `log_level=verbose`, `log_level=WARNING`, `log_level=notice`.","commonSituations":"Users familiar with syslog severities (notice, warning spelled differently) or other logging frameworks using names logrus does not accept; matching is case-insensitive but names must be exact logrus levels.","solutions":["Use one of: trace, debug, info, warn, error, fatal, panic (case-insensitive)","Replace unsupported names like `notice`, `verbose`, or `warning` with the closest valid level (e.g. `warning` -> `warn`)","Omit the parameter to keep the logger at its default level","Check the wrapped logrus error, which lists the accepted values"],"exampleFix":"// before\nurl: victorialogs+http://127.0.0.1:8428?log_level=warning\n// after\nurl: victorialogs+http://127.0.0.1:8428?log_level=warn","handlingStrategy":"validation","validationCode":"const VALID = [\"panic\",\"fatal\",\"error\",\"warn\",\"info\",\"debug\",\"trace\"]\nconst lvl = p.searchParams.get(\"log_level\")\nif (lvl && !VALID.includes(lvl.toLowerCase())) {\n  throw new Error(`invalid log_level: ${lvl}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the logrus level set: panic, fatal, error, warn, info, debug, trace","Map syslog/other-framework names to logrus equivalents (warning->warn, notice->info)","Leave log_level unset to inherit the service's default level"],"tags":["config","logging","victorialogs"],"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-14T05:17:10.506Z"}