{"record":{"id":"eb920ff3aaf22ae2","repo":"cube-js/cube","slug":"unrecognized-log-level","errorCode":null,"errorMessage":"Unrecognized log level: {}","messagePattern":"Unrecognized log level: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/util/logger.rs","lineNumber":22,"sourceCode":"use std::env;\n\npub fn string_to_level(text: String) -> std::result::Result<Level, String> {\n    let level = match text.as_str() {\n        \"error\" => Level::Error,\n        \"warn\" => Level::Warn,\n        \"info\" => Level::Info,\n        \"debug\" => Level::Debug,\n        \"trace\" => Level::Trace,\n        _ => return Err(text),\n    };\n    Ok(level)\n}\n\n/// Logger will add 'CUBESTORE_LOG_CONTEXT' to all messages.\n/// Set it during `procspawn` to help distinguish processes in the logs.\npub fn init_cube_logger(enable_telemetry: bool) {\n    let global_level = env::var(\"CUBESTORE_GLOBAL_LOG_LEVEL\").map_or(Level::Error, |x| {\n        string_to_level(x).unwrap_or_else(|x| panic!(\"Unrecognized log level: {}\", x))\n    });\n    let cubestore_log_level = env::var(\"CUBESTORE_LOG_LEVEL\").map_or(Level::Info, |x| {\n        string_to_level(x).unwrap_or_else(|x| panic!(\"Unrecognized log level: {}\", x))\n    });\n    let df_log_level = env::var(\"CUBESTORE_DATAFUSION_LOG_LEVEL\").map_or(global_level, |x| {\n        string_to_level(x).unwrap_or_else(|x| panic!(\"Unrecognized log level: {}\", x))\n    });\n\n    let logger = SimpleLogger::new()\n        .with_level(global_level.to_level_filter())\n        .with_module_level(\"cubestore\", cubestore_log_level.to_level_filter())\n        .with_module_level(\"datafusion\", df_log_level.to_level_filter());\n\n    let mut ctx = format!(\"pid:{}\", std::process::id());\n    if let Ok(extra) = env::var(\"CUBESTORE_LOG_CONTEXT\") {\n        ctx += \" \";\n        ctx += &extra;\n    }","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/util/logger.rs#L4-L40","documentation":"init_cube_logger parses CUBESTORE_GLOBAL_LOG_LEVEL and panics if string_to_level doesn't recognize the value. Valid values are standard log levels (error/warn/info/debug/trace, case-insensitive). A bad value aborts startup.","triggerScenarios":"Setting CUBESTORE_GLOBAL_LOG_LEVEL to anything string_to_level rejects, e.g. CUBESTORE_GLOBAL_LOG_LEVEL=verbose or =logging, then starting Cube Store.","commonSituations":"Typos in deployment config/manifests; copying level names from other frameworks (e.g. 'fatal', 'none', numeric levels); Kubernetes/env-file misconfiguration.","solutions":["Set CUBESTORE_GLOBAL_LOG_LEVEL to one of: error, warn, info, debug, trace (case-insensitive)","Check the exact value in your environment: printenv CUBESTORE_GLOBAL_LOG_LEVEL","Remove the variable entirely to use the default (Error for global level)"],"exampleFix":"// before\nCUBESTORE_GLOBAL_LOG_LEVEL=verbose\n// after\nCUBESTORE_GLOBAL_LOG_LEVEL=info","handlingStrategy":"validation","validationCode":"const VALID = new Set(['error','warn','info','debug','trace']);\nconst lvl = process.env.CUBESTORE_GLOBAL_LOG_LEVEL;\nif (lvl && !VALID.has(lvl.toLowerCase())) throw new Error(`CUBESTORE_GLOBAL_LOG_LEVEL must be one of ${[...VALID]}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use error|warn|info|debug|trace for CUBESTORE_*_LOG_LEVEL vars","Validate env vars in deployment CI before rollout","Watch for typos and non-standard names like fatal/none"],"tags":["cubestore","logging","panic","env-var","configuration"],"backgroundTag":"invalid-env-var-value","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}