Skip to content
Discussion options

You must be logged in to vote

The Trace middleware doesn't support that. It's a bit complicated since the body is an async stream, so in order to log it you need to buffer the whole thing, which doesn't work for infinite streams and Trace needs to support those.

You can roll your own tracing middleware pretty easily though and can consume the body like this https://github.com/tokio-rs/axum/blob/main/examples/consume-body-in-extractor-or-middleware/src/main.rs

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ehamberg
Comment options

Answer selected by ehamberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants