Logging request body doesn't work for me because the body was already read at the time of logging.
So the body should be read before other handlers can read it.
b, _ := io.ReadAll(r.Body)
r.Body = io.NopCloser(bytes.NewBuffer(b))
...
param := LogFormatterParams{
Request: r,
RequestBody: b,
isTerm: isTerm,
}
Logging request body doesn't work for me because the body was already read at the time of logging.
So the body should be read before other handlers can read it.
like: