cube-js/cube · error

Failed to initialize logger

Error message

Failed to initialize logger

What it means

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.

Source

Thrown at rust/cubestore/cubestore/src/util/logger.rs:46

        string_to_level(x).unwrap_or_else(|x| panic!("Unrecognized log level: {}", x))
    });

    let logger = SimpleLogger::new()
        .with_level(global_level.to_level_filter())
        .with_module_level("cubestore", cubestore_log_level.to_level_filter())
        .with_module_level("datafusion", df_log_level.to_level_filter());

    let mut ctx = format!("pid:{}", std::process::id());
    if let Ok(extra) = env::var("CUBESTORE_LOG_CONTEXT") {
        ctx += " ";
        ctx += &extra;
    }
    let mut logger: Box<dyn Log> = Box::new(ContextLogger::new(ctx, logger));
    if enable_telemetry {
        logger = Box::new(ReportingLogger::new(logger))
    }

    log::set_boxed_logger(logger).expect("Failed to initialize logger");
    log::set_max_level(cubestore_log_level.to_level_filter());
}

/// Adds the same 'context' string to all log messages.
pub struct ContextLogger<Logger> {
    context: String,
    inner: Logger,
}

impl<Logger: Log> ContextLogger<Logger> {
    pub fn new(context: String, inner: Logger) -> Self {
        Self { context, inner }
    }
}

impl<Logger: Log> Log for ContextLogger<Logger> {
    fn enabled<'a>(&self, metadata: &Metadata<'a>) -> bool {
        self.inner.enabled(metadata)

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Check telemetry-related configuration values for correctness
  2. Disable telemetry if it is not needed
  3. Inspect startup logs or run with more verbose logging to surface the underlying initialization failure
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at rust/cubestore/cubestore/src/util/logger.rs:46 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/eedc052313eada2b. Report an issue: GitHub.