Skip to content

How to log request body using tracing #1133

Answered by davidpdrsn
davidbnk asked this question in Q&A
Discussion options

You must be logged in to vote

This is hard because the body is an async stream that can only be consumed once.

I would recommend logging things in your handlers as necessary without relying on middleware.

You can probably also write a middleware that does it but it's not simple. I don't believe we have any examples of doing that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidbnk
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