http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.46k stars 120 forks source link

surf middleware logging does not print the actual response status #188

Open anuprout opened 4 years ago

anuprout commented 4 years ago

Hi,

It was observed that the surf::middleware::logger::native module is not printing the http status when a client or server error happens. Below is the sample log we get.

2020-06-09T13:43:04.016939833+00:00 ERROR surf::middleware::logger::native - request completed 2020-06-09T13:43:04.647317060+00:00 ERROR surf::middleware::logger::native - request completed 2020-06-09T13:43:07.933639018+00:00 ERROR surf::middleware::logger::native - request completed 2020-06-09T13:43:08.811188678+00:00 ERROR surf::middleware::logger::native - request completed 2020-06-09T13:43:08.838813369+00:00 ERROR surf::middleware::logger::native - request completed

Looking at the code it looks like it is supposed to print the status as well. We are using 2.0.0-alpha.1 version. Please advise. Thanks

goto-bus-stop commented 4 years ago

@anuprout I think this may depend on the logger used. surf's middleware uses key-value logging which might not be supported by every log-based logger yet. Could that be it?