{"record":{"id":"4d67b1a5b7c4e122","repo":"grafana/k6","slug":"unsupported-log-output-s","errorCode":null,"errorMessage":"unsupported log output '%s'","messagePattern":"unsupported log output '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/root.go","lineNumber":390,"sourceCode":"\tcase line == \"none\":\n\t\tc.globalState.Logger.SetOutput(io.Discard)\n\tcase strings.HasPrefix(line, \"loki\"):\n\t\tc.loggerIsRemote = true\n\t\thook, err = log.LokiFromConfigLine(c.globalState.FallbackLogger, line)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.globalState.Flags.LogFormat = \"raw\"\n\tcase strings.HasPrefix(line, \"file\"):\n\t\thook, err = log.FileHookFromConfigLine(\n\t\t\tc.globalState.FS, c.globalState.Getwd,\n\t\t\tc.globalState.FallbackLogger, line,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported log output '%s'\", line)\n\t}\n\n\tsetupLogFormat(c, loggerForceColors)\n\n\tsecretsources, err := createSecretSources(c.globalState)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// it is important that we add this hook first as hooks are executed in order of addition\n\t// and this means no other hook will get secrets\n\tvar secretsHook logrus.Hook\n\tc.globalState.SecretsManager, secretsHook, err = secretsource.NewManager(secretsources)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(secretsources) != 0 {\n\t\t// don't actually filter anything if there will be no secrets\n\t\tc.globalState.Logger.AddHook(secretsHook)","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/cmd/root.go#L372-L408","documentation":"--log-output (or K6_LOG_OUTPUT) accepts only the exact values stderr, stdout, none, or values with the prefixes loki (e.g. loki=http://...) and file (e.g. file=k6.log). Anything else falls through to the default branch in setupLoggers and k6 exits with this error at startup, before any test runs.","triggerScenarios":"k6 run --log-output=syslog script.js; --log-output=journald; --log-output=cloud; a typo like stoud. Values that merely start with loki/file parse further and fail with a different message — this error is only for unrecognized prefixes/values.","commonSituations":"Assuming k6 supports syslog/journald because other CLIs do; porting logging config from other load-testing tools; CI templates with a wrong env value for K6_LOG_OUTPUT.","solutions":["Use a supported sink: --log-output=stderr (default), stdout, none, file=./k6.log, or loki=<url>","For on-disk logs: --log-output=file=k6.log; for Loki: --log-output='loki=http://loki:3100/loki/api/v1/push'","For syslog/journald collection, write to stdout/file and let the surrounding system (systemd, docker logging driver) ship it"],"exampleFix":"// before\nk6 run --log-output=syslog script.js\n\n// after\nk6 run --log-output=file=k6.log script.js","handlingStrategy":"validation","validationCode":"# validate --log-output before running\nvalidate_log_output() {\n  local v=\"$1\"\n  case \"$v\" in\n    stderr|stdout|none|loki*|file*) return 0;;\n    *) echo \"unsupported log output '$v' (use stderr|stdout|none|file=...|loki=...)\" >&2; return 1;;\n  esac\n}\nvalidate_log_output \"$K6_LOG_OUTPUT\" || exit 1\nk6 run script.js","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize the log-output value in one CI variable and validate it in a preflight step","Remember only five forms exist: stderr, stdout, none, file..., loki... — there is no syslog/journald sink","For external log collectors, ship stdout/file output with the collector instead of inventing a k6 sink"],"tags":["k6","logging","cli-flag","log-output","config"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-31T22:51:04.189Z","contentChangedAt":"2026-08-31T22:51:04.189Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}