diff --git a/tower-http/src/trace/on_request.rs b/tower-http/src/trace/on_request.rs index bd1b98fb..0e343ae5 100644 --- a/tower-http/src/trace/on_request.rs +++ b/tower-http/src/trace/on_request.rs @@ -60,9 +60,15 @@ impl DefaultOnRequest { /// Set the [`Level`] used for [tracing events]. /// + /// Please note that while this will set the level for the tracing events + /// themselves, it might cause them to lack expected information, like + /// request method or path. You can address this using + /// [`DefaultMakeSpan::level`]. + /// /// Defaults to [`Level::DEBUG`]. /// /// [tracing events]: https://docs.rs/tracing/latest/tracing/#events + /// [`DefaultMakeSpan::level`]: crate::trace::DefaultMakeSpan::level pub fn level(mut self, level: Level) -> Self { self.level = level; self diff --git a/tower-http/src/trace/on_response.rs b/tower-http/src/trace/on_response.rs index 6fa595fa..4b02a574 100644 --- a/tower-http/src/trace/on_response.rs +++ b/tower-http/src/trace/on_response.rs @@ -68,9 +68,15 @@ impl DefaultOnResponse { /// Set the [`Level`] used for [tracing events]. /// + /// Please note that while this will set the level for the tracing events + /// themselves, it might cause them to lack expected information, like + /// request method or path. You can address this using + /// [`DefaultMakeSpan::level`]. + /// /// Defaults to [`Level::DEBUG`]. /// /// [tracing events]: https://docs.rs/tracing/latest/tracing/#events + /// [`DefaultMakeSpan::level`]: crate::trace::DefaultMakeSpan::level pub fn level(mut self, level: Level) -> Self { self.level = level; self