From b36dd3aa816e3658fcbd8140761fc21f5ab6582e Mon Sep 17 00:00:00 2001 From: Allen Huang Date: Sun, 22 Feb 2026 19:43:54 +0800 Subject: [PATCH] feat(logging): use local timezone for log timestamps Replace default UTC timer with ChronoLocal::rfc_3339() so daemon and CLI log lines display the operator's local time, making correlation with external events easier. Co-Authored-By: Claude Opus 4.6 (1M context) --- Cargo.lock | 1 + Cargo.toml | 2 +- src/main.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 980394c7c..f7cfb4f44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6639,6 +6639,7 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ + "chrono", "matchers", "nu-ansi-term", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 44da3442b..dd19945c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ schemars = "1.2" # Logging - minimal tracing = { version = "0.1", default-features = false } -tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi", "env-filter"] } +tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi", "env-filter", "chrono"] } # Observability - Prometheus metrics prometheus = { version = "0.14", default-features = false } diff --git a/src/main.rs b/src/main.rs index e009ad96c..484000cec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -713,6 +713,7 @@ async fn main() -> Result<()> { // Initialize logging - respects RUST_LOG env var, defaults to INFO let subscriber = fmt::Subscriber::builder() + .with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339()) .with_env_filter( EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")), )