Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editoast: add default log directive to display all HTTP calls #8830

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

woshilapin
Copy link
Contributor

@woshilapin woshilapin commented Sep 11, 2024

As a webservice, it's convenient that the default logs show all the request that goes in. For each request coming in, we should now see something like this.

  2024-09-11T04:58:17.332243Z DEBUG tower_http::trace::on_request: started processing request
    at /home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tower-http-0.5.2/src/trace/on_request.rs
    in tower_http::trace::make_span::request with method: GET, uri: /, version: HTTP/1.1

  2024-09-11T04:58:17.332532Z DEBUG tower_http::trace::on_response: finished processing request, latency: 0 ms, status: 404
    at /home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tower-http-0.5.2/src/trace/on_response.rs
    in tower_http::trace::make_span::request with method: GET, uri: /, version: HTTP/1.1

In reality, the `tracing` feature was already pulled by some other
dependency in our dependencies' tree, but yet, it's more correct
that we define it since we want to use it.

Signed-off-by: Jean SIMARD <[email protected]>
@woshilapin woshilapin requested a review from a team as a code owner September 11, 2024 16:07
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.03%. Comparing base (a902ca2) to head (75cf679).
Report is 6 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #8830      +/-   ##
============================================
- Coverage     37.07%   37.03%   -0.04%     
+ Complexity     2212     2209       -3     
============================================
  Files          1255     1255              
  Lines        114111   114138      +27     
  Branches       3189     3182       -7     
============================================
- Hits          42307    42275      -32     
- Misses        69907    69971      +64     
+ Partials       1897     1892       -5     
Flag Coverage Δ
core 74.79% <ø> (-0.01%) ⬇️
editoast 72.39% <ø> (-0.04%) ⬇️
front 14.92% <ø> (-0.02%) ⬇️
gateway 2.20% <ø> (ø)
osrdyne 2.71% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@woshilapin woshilapin force-pushed the wsl/feat/default-logs-tower-http branch from fe7aa7a to 75cf679 Compare September 11, 2024 16:48
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I find the 'tower' logs a little less readable than with actix, but it's better than nothing.

Copy link
Contributor

@anisometropie anisometropie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

@woshilapin woshilapin added this pull request to the merge queue Sep 12, 2024
Merged via the queue into dev with commit a338a73 Sep 12, 2024
23 checks passed
@woshilapin woshilapin deleted the wsl/feat/default-logs-tower-http branch September 12, 2024 09:40
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.

4 participants