From 9ba7f742ef04edf0f90c61c2e52c8716cfb3a0c8 Mon Sep 17 00:00:00 2001 From: Luke Mann Date: Wed, 29 Nov 2023 06:26:20 -0800 Subject: [PATCH] add json trace config (#9) --- Cargo.lock | 20 ++++++++++++++++++++ Cargo.toml | 2 +- src/main.rs | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 483af62..4d68ef7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1178,6 +1178,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", ] [[package]] @@ -1186,9 +1197,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ + "serde", + "serde_json", "sharded-slab", "thread_local", "tracing-core", + "tracing-serde", ] [[package]] @@ -1239,6 +1253,12 @@ dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index fc11829..fc01b69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ tower-http = { version = "0.4.3", features = ["cors"] } uuid = { version = "1.4.1", features = ["v4", "serde"] } redis = { version = "0.23.0", features = ["tokio-comp", "connection-manager", "tokio-native-tls-comp"] } tracing-subscriber = { version = "0.3", default-features = false, features = [ - "fmt", + "fmt","json" ] } serde_path_to_error = "0.1.14" async-trait = "0.1.74" diff --git a/src/main.rs b/src/main.rs index c184969..62907a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,10 @@ async fn main() { tracing_subscriber::fmt() .with_max_level(tracing::Level::INFO) + .json() .with_target(false) + .flatten_event(true) + .without_time() .init(); tracing::info!("Starting wallet bridge...");