{"record":{"id":"593736e75c717884","repo":"zeroclaw-labs/zeroclaw","slug":"service-log-viewing-is-supported-on-macos-linux","errorCode":null,"errorMessage":"Service log viewing is supported on macOS, Linux, and Windows only","messagePattern":"Service log viewing is supported on macOS, Linux, and Windows only","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/service/mod.rs","lineNumber":948,"sourceCode":"            println!(\"Unit: /etc/init.d/{}\", linux_openrc_service(config));\n        }\n        InitSystem::Auto => unreachable!(\"Auto should be resolved before this point\"),\n    }\n    Ok(())\n}\n\npub fn logs(config: &Config, init_system: InitSystem, lines: usize, follow: bool) -> Result<()> {\n    if cfg!(target_os = \"macos\") {\n        return logs_macos(config, lines, follow);\n    }\n    if cfg!(target_os = \"linux\") {\n        let resolved = init_system.resolve()?;\n        return logs_linux(config, resolved, lines, follow);\n    }\n    if cfg!(target_os = \"windows\") {\n        return logs_windows(config, lines, follow);\n    }\n    anyhow::bail!(\"Service log viewing is supported on macOS, Linux, and Windows only\")\n}\n\nfn logs_macos(config: &Config, lines: usize, follow: bool) -> Result<()> {\n    // Try the launchd log files first (StandardOutPath / StandardErrorPath from the plist).\n    // These are the most reliable source since they capture all daemon output.\n    let exe = std::env::current_exe().ok();\n    let homebrew_var_dir = exe.as_ref().and_then(|e| homebrew_var_dir_from_exe(e));\n    let logs_dir = if let Some(ref var_dir) = homebrew_var_dir {\n        var_dir.join(\"logs\")\n    } else {\n        config\n            .config_path\n            .parent()\n            .map_or_else(|| PathBuf::from(\".\"), PathBuf::from)\n            .join(\"logs\")\n    };\n\n    let stderr_log = logs_dir.join(\"daemon.stderr.log\");","sourceCodeStart":930,"sourceCodeEnd":966,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/service/mod.rs#L930-L966","documentation":"logs() dispatches to logs_macos, logs_linux (after resolving the init system) or logs_windows. Unlike the management verbs, the message correctly includes Windows; the bail fires only on remaining platforms such as the BSDs.","triggerScenarios":"Running 'zeroclaw service logs' on a platform where none of the three cfg! branches match.","commonSituations":"Attempting to tail daemon logs on FreeBSD/OpenBSD builds; scripts assuming journalctl-like tooling exists everywhere.","solutions":["Read the daemon's log files directly with tail on whatever path your manual service definition uses","Run the daemon in the foreground during debugging instead of relying on 'service logs'","Add platform support or route logging to a file you control"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn service_logs_supported() -> bool {\n    cfg!(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\"))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Route daemon logging to a file you control on unsupported platforms","Gate 'service logs' by OS in tooling","Run the daemon in the foreground when you need logs off-platform"],"tags":["platform-support","bsd","service","logs"],"backgroundTag":"unsupported-platform","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}