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

Use status code for trace filter log level / message. #981

Merged
merged 1 commit into from Jul 6, 2022

Conversation

jakajancar
Copy link
Contributor

Currently, the warp::trace() filter assumes that:

  • Ok response from filter => INFO / "finished processing with success"
  • Err / rejection from filter => ERROR / "unable to process request" (5xx); or WARN / "unable to serve request" (4xx)

However, this doesn't work well with custom rejections:

Normally you will .recover() the rejection and return a 4xx/5xx reply. warp::trace() will currently log INFO / "finished processing with success", as if everything is OK, whereas it should log WARN/ERROR, same as for known rejections.

This PR changes the logging to be based only on the status code.

@jakajancar jakajancar changed the title Use status code for trace filter message. Use status code for trace filter log level / message. Jul 3, 2022
@jxs jxs merged commit 5723cac into seanmonstar:master Jul 6, 2022
@jxs
Copy link
Collaborator

jxs commented Jul 6, 2022

Hi, yeah this makes sense thanks!

@jakajancar jakajancar deleted the trace-log-level-based-on-status branch July 6, 2022 11:56
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.

None yet

2 participants