{"record":{"id":"c2aad290151d3584","repo":"zed-industries/zed","slug":"no-rotation-log-file-path-configured","errorCode":null,"errorMessage":"No rotation log file path configured","messagePattern":"No rotation log file path configured","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zlog/src/sink.rs","lineNumber":269,"sourceCode":"        }\n        if self.ansi {\n            f.write_str(ANSI_RESET)?;\n        }\n        f.write_char(']')?;\n        Ok(())\n    }\n}\n\nfn rotate_log_file<PathRef>(\n    path: Option<PathRef>,\n    path_rotate: Option<PathRef>,\n) -> std::io::Result<Option<fs::File>>\nwhere\n    PathRef: AsRef<std::path::Path>,\n{\n    let path = path.as_ref().map(PathRef::as_ref);\n    let rotation_error = match (path, path_rotate) {\n        (Some(_), None) => Some(anyhow::anyhow!(\"No rotation log file path configured\")),\n        (None, _) => Some(anyhow::anyhow!(\"No log file path configured\")),\n        (Some(path), Some(path_rotate)) => fs::copy(path, path_rotate)\n            .err()\n            .map(|err| anyhow::anyhow!(err)),\n    };\n    if let Some(err) = rotation_error {\n        eprintln!(\"Log file rotation failed. Truncating log file anyways: {err}\",);\n    }\n    path.map(|path| {\n        fs::OpenOptions::new()\n            .create(true)\n            .write(true)\n            .truncate(true)\n            .open(path)\n    })\n    .transpose()\n}\n","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zlog/src/sink.rs#L251-L287","documentation":"Log rotation was requested (a log file path is set) but no rotation file path was configured alongside it, so rotate_log_file cannot build the rotation target. Configuration is incomplete rather than the environment failing.","triggerScenarios":"Thrown at crates/zlog/src/sink.rs:269 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the rotation log file path together with the primary log file path","Skip rotation (log to the single file) when no rotation path is provided"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}