diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-04 12:57:04 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-04 12:57:04 -0600 |
| commit | afba4a7c66663b284301e71c9045620beef1c120 (patch) | |
| tree | e3a7c2bf7077729958bf7812e18f40ad0eb432a9 /src | |
| parent | 6b8c59801ea745130ad33b09df758646fbbff3da (diff) | |
chore: fix the request headers formatting in the json logs
Diffstat (limited to 'src')
| -rw-r--r-- | src/authorization/server.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/authorization/server.rs b/src/authorization/server.rs index 2229163a..23b7720e 100644 --- a/src/authorization/server.rs +++ b/src/authorization/server.rs @@ -37,11 +37,19 @@ impl Server { { let builder = tonic::transport::Server::builder() .trace_fn(|req| { + tracing::info!( + method = %req.method(), + path = %req.uri().path(), + content_type = ?req.headers().get("content-type").and_then(|v| v.to_str().ok()), + user_agent = ?req.headers().get("user-agent").and_then(|v| v.to_str().ok()), + x_request_id = ?req.headers().get("x-request-id").and_then(|v| v.to_str().ok()), + "gRPC request" + ); + tracing::info_span!( "request", method = %req.method(), path = %req.uri().path(), - headers = ?req.headers(), ) }) .timeout(std::time::Duration::from_secs(30)); |
