{"record":{"id":"abdd55c2a5830d64","repo":"grafana/k6","slug":"unknown-logfile-config-key-s","errorCode":null,"errorMessage":"unknown logfile config key %s","messagePattern":"unknown logfile config key (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/log/file.go","lineNumber":80,"sourceCode":"\ttokens, err := strvals.Parse(line)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while parsing logfile configuration %w\", err)\n\t}\n\n\tfor _, token := range tokens {\n\t\tswitch token.Key {\n\t\tcase \"file\":\n\t\t\tif token.Value == \"\" {\n\t\t\t\treturn fmt.Errorf(\"filepath must not be empty\")\n\t\t\t}\n\t\t\th.path = token.Value\n\t\tcase \"level\":\n\t\t\th.levels, err = parseLevels(token.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown logfile config key %s\", token.Key)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// openFile opens logfile and initializes writers.\nfunc (h *fileHook) openFile(getCwd func() (string, error)) error {\n\tpath := h.path\n\tif !filepath.IsAbs(path) {\n\t\tcwd, err := getCwd()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"'%s' is a relative path but could not determine CWD: %w\", path, err)\n\t\t}\n\t\tpath = filepath.Join(cwd, path)\n\t}\n\n\tif _, err := h.fs.Stat(filepath.Dir(path)); errors.Is(err, fs.ErrNotExist) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/log/file.go#L62-L98","documentation":"A validation guard in parseArgs for the logfile configuration. Only 'file' and 'level' keys are accepted; it fires for any other token key. The at-fault input is the unknown key in the `file=...` config line.","triggerScenarios":"Thrown at internal/log/file.go:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only supported keys: file=<path> and level=<level>","Remove or correct the unsupported key in the --log-output value","Check for typos such as 'lvl' or 'path' instead of the accepted keys"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}