{"record":{"id":"eedc052313eada2b","repo":"cube-js/cube","slug":"failed-to-initialize-logger","errorCode":null,"errorMessage":"Failed to initialize logger","messagePattern":"Failed to initialize logger","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/util/logger.rs","lineNumber":46,"sourceCode":"        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    }\n    let mut logger: Box<dyn Log> = Box::new(ContextLogger::new(ctx, logger));\n    if enable_telemetry {\n        logger = Box::new(ReportingLogger::new(logger))\n    }\n\n    log::set_boxed_logger(logger).expect(\"Failed to initialize logger\");\n    log::set_max_level(cubestore_log_level.to_level_filter());\n}\n\n/// Adds the same 'context' string to all log messages.\npub struct ContextLogger<Logger> {\n    context: String,\n    inner: Logger,\n}\n\nimpl<Logger: Log> ContextLogger<Logger> {\n    pub fn new(context: String, inner: Logger) -> Self {\n        Self { context, inner }\n    }\n}\n\nimpl<Logger: Log> Log for ContextLogger<Logger> {\n    fn enabled<'a>(&self, metadata: &Metadata<'a>) -> bool {\n        self.inner.enabled(metadata)","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/util/logger.rs#L28-L64","documentation":"During logger initialization, the telemetry logger component failed to initialize (for example a connectivity or configuration problem in the telemetry sink) and the whole logger setup was aborted. Because this happens in init_cube_logger at startup, the Cube Store process has not started serving yet — earlier console output may hold the underlying cause.","triggerScenarios":"Thrown at rust/cubestore/cubestore/src/util/logger.rs:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check telemetry-related configuration values for correctness","Disable telemetry if it is not needed","Inspect startup logs or run with more verbose logging to surface the underlying initialization failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}