{"record":{"id":"8a921a7e6c09e5a3","repo":"biomejs/biome","slug":"failed-to-start-the-logger-for-the-daemon","errorCode":null,"errorMessage":"Failed to start the logger for the daemon.","messagePattern":"Failed to start the logger for the daemon\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/biome_cli/src/commands/daemon.rs","lineNumber":220,"sourceCode":"\n/// Set up the [tracing]-based logging system for the server\n/// The events received by the subscriber are filtered at the `info` level,\n/// then printed using the [HierarchicalLayer] layer, and the resulting text\n/// is written to log files rotated on a hourly basis (in\n/// `biome-logs/server.log.yyyy-MM-dd-HH` files inside the system temporary\n/// directory)\nfn setup_daemon_subscriber(\n    log_path: Utf8PathBuf,\n    log_file_name_prefix: String,\n    level: LoggingLevel,\n) {\n    let appender_builder = tracing_appender::rolling::RollingFileAppender::builder();\n    let file_appender = appender_builder\n        .filename_prefix(log_file_name_prefix)\n        .max_log_files(7)\n        .rotation(Rotation::HOURLY)\n        .build(log_path)\n        .expect(\"Failed to start the logger for the daemon.\");\n\n    registry()\n        .with(\n            HierarchicalLayer::default()\n                .with_indent_lines(true)\n                .with_indent_amount(2)\n                .with_bracketed_fields(true)\n                .with_targets(true)\n                .with_ansi(false)\n                .with_writer(file_appender)\n                .with_filter(LoggingFilter { level }),\n        )\n        .init();\n}\n\npub fn default_biome_log_path() -> Utf8PathBuf {\n    match env::var_os(\"BIOME_LOG_PATH\") {\n        Some(directory) => Utf8PathBuf::from(directory.as_os_str().to_str().unwrap()),","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/biomejs/biome/blob/45a19bbf1747401274f1be1f9f89d6af91367190/crates/biome_cli/src/commands/daemon.rs#L202-L238","documentation":"Error \"Failed to start the logger for the daemon.\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_cli/src/commands/daemon.rs:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the log directory exists and is writable before starting the daemon.","Inspect the underlying IO error attached to this error for the root cause."],"exampleFix":"std::fs::create_dir_all(log_dir)?; // before initializing the daemon logger","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"45a19bbf1747401274f1be1f9f89d6af91367190","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}