Skip to content

feat: Add middleware to log the request/response payloads - #304

Merged
spencewenski merged 1 commit into
mainfrom
log-req-res
Jul 31, 2024
Merged

spencewenski merged 1 commit into
mainfrom
log-req-res

Conversation

@spencewenski

Copy link
Copy Markdown
Member

It can be useful when developing an application to be able to see the request/response bodies as they are seen by the server. Add an Axum middleware to do this. Because the middleware buffers the entire request/response, it is disabled by default. If we add a mechanism to provide different defaults per environment, this middleware may be enabled in non-prod environments by default in the future.

It can be useful when developing an application to be able to see the
request/response bodies as they are seen by the server. Add an Axum
middleware to do this. Because the middleware buffers the entire
request/response, it is disabled by default. If we add a mechanism to
provide different defaults per environment, this middleware may be
enabled in non-prod environments by default in the future.
@codecov

codecov Bot commented Jul 31, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 45.61404% with 31 lines in your changes missing coverage. Please review.

Project coverage is 47.91%. Comparing base (2d6d4ec) to head (7aecf30).

Files Patch % Lines
...service/http/middleware/tracing/req_res_logging.rs 44.64% 31 Missing ⚠️
Files Coverage Δ
src/config/service/http/middleware.rs 100.00% <ø> (ø)
src/service/http/middleware/default.rs 100.00% <100.00%> (ø)
src/service/http/middleware/tracing/mod.rs 25.68% <ø> (ø)
...service/http/middleware/tracing/req_res_logging.rs 44.64% <44.64%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d6d4ec...7aecf30. Read the comment docs.

@spencewenski
spencewenski merged commit 20b5eea into main Jul 31, 2024
@spencewenski
spencewenski deleted the log-req-res branch July 31, 2024 08:09
@github-actions github-actions Bot mentioned this pull request Jul 31, 2024
spencewenski pushed a commit that referenced this pull request Jul 31, 2024
## 🤖 New release
* `roadster`: 0.5.12 -> 0.5.13

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.5.13](roadster-v0.5.12...roadster-v0.5.13)
- 2024-07-31

### Added
- Add middleware to log the request/response payloads
([#304](#304))
- Log errors at debug level in `IntoResponse` impl
([#303](#303))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant