From 3ecefff7bbac314595718de65a1bb907c35c9240 Mon Sep 17 00:00:00 2001 From: 82marbag <69267416+82marbag@users.noreply.github.com> Date: Tue, 6 Dec 2022 07:04:58 -0500 Subject: [PATCH] Tracing output json (#2060) * Tracing output json Signed-off-by: Daniele Ahmed --- .../aws-smithy-http-server/examples/pokemon-service/Cargo.toml | 2 +- .../aws-smithy-http-server/examples/pokemon-service/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/Cargo.toml b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/Cargo.toml index 51f9c6f1a..06738fcc5 100644 --- a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/Cargo.toml +++ b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/Cargo.toml @@ -32,7 +32,7 @@ tokio = "1.20.1" tower = "0.4" tower-http = { version = "0.3", features = ["trace"] } tracing = "0.1" -tracing-subscriber = { version = "0.3.15", features = ["env-filter"] } +tracing-subscriber = { version = "0.3.15", features = ["env-filter", "json"] } # These dependencies are only required for the `pokemon-service-tls` program. tls-listener = { version = "0.5.1", features = ["rustls", "hyper-h2"] } diff --git a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs index acaeb55c0..a052837b2 100644 --- a/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs +++ b/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/lib.rs @@ -32,7 +32,7 @@ const PIKACHU_JAPANESE_FLAVOR_TEXT: &str = /// Setup `tracing::subscriber` to read the log level from RUST_LOG environment variable. pub fn setup_tracing() { - let format = tracing_subscriber::fmt::layer().pretty(); + let format = tracing_subscriber::fmt::layer().json(); let filter = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new("info")) .unwrap(); -- GitLab