{"record":{"id":"6ce7fd57d338202f","repo":"vllm-project/vllm","slug":"failed-to-parse-rust-log","errorCode":null,"errorMessage":"failed to parse `RUST_LOG`","messagePattern":"failed to parse `RUST_LOG`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"rust/src/tracing/src/lib.rs","lineNumber":65,"sourceCode":"}\n\n/// Build the CLI log filter by merging the vLLM-style default level with\n/// Rust-style target overrides.\n///\n/// Precedence:\n/// - Start from `VLLM_LOGGING_LEVEL` as the default level for all targets.\n/// - If `RUST_LOG` contains a global default level such as `warn`, it overrides\n///   `VLLM_LOGGING_LEVEL`.\n/// - Any explicit target directives in `RUST_LOG`, such as `hyper=info`, override whichever default\n///   level is active for those targets only.\nfn build_targets_filter(vllm_logging_level: Option<&str>, rust_log: Option<&str>) -> Targets {\n    let mut filter =\n        Targets::new().with_default(map_python_log_level(vllm_logging_level.unwrap_or(\"INFO\")));\n\n    if let Some(rust_log) = rust_log\n        && !rust_log.is_empty()\n    {\n        let rust_log_targets: Targets = rust_log.parse().expect(\"failed to parse `RUST_LOG`\");\n        if let Some(default_level) = rust_log_targets.default_level() {\n            filter = filter.with_default(default_level);\n        }\n        filter = filter.with_targets(rust_log_targets);\n    }\n\n    filter\n}\n\n#[derive(Debug, Clone, Copy)]\nstruct VllmLocalTimer {\n    local_offset: UtcOffset,\n}\n\nimpl Default for VllmLocalTimer {\n    fn default() -> Self {\n        let local_offset = UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC);\n        Self { local_offset }","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/tracing/src/lib.rs#L47-L83","documentation":"Startup panic in the Rust tracing setup (rust/src/tracing/src/lib.rs:65): the value of the `RUST_LOG` environment variable cannot be parsed as a tracing-subscriber `Targets` filter (e.g. `RUST_LOG=hyper=info,=debug` or `RUST_LOG=,,`). The `.expect` makes this fatal at frontend initialization, before serving.","triggerScenarios":"Starting the vLLM Rust frontend with a syntactically invalid RUST_LOG: empty directives, dangling `=level`, unknown level names like `RUST_LOG=verbose`, or stray commas/semicolons.","commonSituations":"Copy-pasted RUST_LOG from docs of a different logger; shell quoting that mangles the value; CI environments injecting a RUST_LOG intended for another crate's format; level names valid in Python logging (WARN, DEBUG ok) vs invalid ones.","solutions":["Fix or unset RUST_LOG; valid forms: 'info', 'warn', 'hyper=debug,vllm_engine_core=trace'","Use VLLM_LOGGING_LEVEL for the global default instead, leaving RUST_LOG unset","Print the variable before launch (`echo $RUST_LOG`) to catch quoting artifacts"],"exampleFix":"# before\nRUST_LOG='hyper=info,=debug' vllm serve ...\n\n# after\nRUST_LOG='hyper=info,vllm=debug' vllm serve ...","handlingStrategy":"validation","validationCode":"# validate before launching the frontend\npython - <<'EOF'\nimport os\nv = os.environ.get(\"RUST_LOG\")\nif v:\n    for directive in v.split(','):\n        d = directive.strip()\n        if d and '=' in d:\n            _, level = d.rsplit('=', 1)\n            assert level in {\"trace\",\"debug\",\"info\",\"warn\",\"error\",\"off\"}, f\"bad RUST_LOG: {d}\"\n        elif d:\n            assert d in {\"trace\",\"debug\",\"info\",\"warn\",\"error\",\"off\"}, f\"bad RUST_LOG: {d}\"\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer VLLM_LOGGING_LEVEL and leave RUST_LOG unset unless you need per-target directives","Add a config-lint step in deploy scripts that parses RUST_LOG the same way tracing-subscriber does"],"tags":["rust","tracing","environment","startup","vllm"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}