{"record":{"id":"f5a56b55acf66cf9","repo":"linera-io/linera-protocol","slug":"test-log-rust-log-span-events-must-contain-filter","errorCode":null,"errorMessage":"test-log: RUST_LOG_SPAN_EVENTS must contain filters separated by `,`.\\n\\tFor example: `active` or `new,close`\\n\\tSupported filters: new, enter, exit, close, active, full\\n\\tGot: {value}","messagePattern":"test-log: RUST_LOG_SPAN_EVENTS must contain filters separated by `,`\\.\\\\n\\\\tFor example: `active` or `new,close`\\\\n\\\\tSupported filters: new, enter, exit, close, active, full\\\\n\\\\tGot: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-storage-service/src/server.rs","lineNumber":621,"sourceCode":"        .with_default_directive(tracing_subscriber::filter::LevelFilter::INFO.into())\n        .from_env_lossy();\n    let internal_event_filter = {\n        match std::env::var_os(\"RUST_LOG_SPAN_EVENTS\") {\n            Some(mut value) => {\n                value.make_ascii_lowercase();\n                let value = value\n                    .to_str()\n                    .expect(\"test-log: RUST_LOG_SPAN_EVENTS must be valid UTF-8\");\n                value\n                    .split(',')\n                    .map(|filter| match filter.trim() {\n                        \"new\" => FmtSpan::NEW,\n                        \"enter\" => FmtSpan::ENTER,\n                        \"exit\" => FmtSpan::EXIT,\n                        \"close\" => FmtSpan::CLOSE,\n                        \"active\" => FmtSpan::ACTIVE,\n                        \"full\" => FmtSpan::FULL,\n                        _ => panic!(\"test-log: RUST_LOG_SPAN_EVENTS must contain filters separated by `,`.\\n\\t\\\n                                     For example: `active` or `new,close`\\n\\t\\\n                                     Supported filters: new, enter, exit, close, active, full\\n\\t\\\n                                     Got: {value}\"),\n                    })\n                    .fold(FmtSpan::NONE, |acc, filter| filter | acc)\n            }\n            None => FmtSpan::NONE,\n        }\n    };\n    tracing_subscriber::fmt()\n        .with_span_events(internal_event_filter)\n        .with_writer(std::io::stderr)\n        .with_env_filter(env_filter)\n        .init();\n\n    let options = <StorageServerOptions as clap::Parser>::parse();\n    let (store, endpoint) = match options {\n        StorageServerOptions::Memory {","sourceCodeStart":603,"sourceCodeEnd":639,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage-service/src/server.rs#L603-L639","documentation":"The storage-service server binary parses RUST_LOG_SPAN_EVENTS to configure tracing span events, splitting on commas and mapping each token to a FmtSpan flag. Recognized filters are new, enter, exit, close, active, full; any other token panics in main during logger initialization, aborting server startup.","triggerScenarios":"Starting linera-storage-service with RUST_LOG_SPAN_EVENTS containing an unknown filter — e.g. 'enter,exit,spawn', 'NEW', 'none', or an empty token from a trailing comma.","commonSituations":"Copy-pasting RUST_LOG_SPAN_EVENTS values used with other Rust projects (test-log's set accepts a similar list but people add others); scripts sharing one env block across services; typo'd filter names.","solutions":["Use only the supported filters: new, enter, exit, close, active, full (comma-separated)","Remove trailing/double commas that create empty tokens","Unset the variable when you don't need span events"],"exampleFix":"# before\nexport RUST_LOG_SPAN_EVENTS=\"new,enter,spawn\"\n\n# after\nexport RUST_LOG_SPAN_EVENTS=\"new,enter\"","handlingStrategy":"validation","validationCode":"const SPAN_FILTERS: [&str; 6] = [\"new\", \"enter\", \"exit\", \"close\", \"active\", \"full\"];\nif let Ok(value) = std::env::var(\"RUST_LOG_SPAN_EVENTS\") {\n    for token in value.split(',') {\n        assert!(SPAN_FILTERS.contains(&token), \"bad RUST_LOG_SPAN_EVENTS token: {token}\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy RUST_LOG_SPAN_EVENTS values only from this project's docs, not other Rust projects","Check for trailing commas when composing the variable in scripts"],"tags":["logging","tracing","environment-variable","storage-service","startup"],"backgroundTag":"invalid-env-var-value","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}