From f64727ca9cd6deb9fdf4dac221a01c14ea3ae685 Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Fri, 18 Oct 2024 12:50:14 +0200 Subject: [PATCH] server: adjust noisy access logs (#51) * server: adjust noisy access logs * Simplify PR 51 --------- Co-authored-by: Ash Manning --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/main.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee6f8fe..037c643 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" diff --git a/Cargo.toml b/Cargo.toml index f8a8c12..edc4a70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,11 @@ tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] } tokio-stream = "0.1.15" tonic = "0.12.3" tonic-reflection = "0.12.3" +tower = "0.5.1" +tower-http = { version = "0.6.1", features = ["trace"] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } zeromq = "0.4.0" -tower = "0.5.1" -tower-http = { version = "0.6.1", features = ["trace"] } [dependencies.bip300301] git = "https://github.com/Ash-L2L/bip300301.git" diff --git a/src/main.rs b/src/main.rs index 4ab7e46..e97f620 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,11 +98,11 @@ async fn run_server( tracing::info!("Listening for gRPC on {addr} with reflection"); - // Adds rather verbose access logging. - // TODO: adjust if it becomes too much. let tracer = ServiceBuilder::new() .layer( TraceLayer::new_for_grpc() + .on_request(()) + .on_eos(()) .on_response(DefaultOnResponse::new().level(tracing::Level::INFO)) .on_failure(DefaultOnFailure::new().level(tracing::Level::ERROR)), )