qdrant icon indicating copy to clipboard operation
qdrant copied to clipboard

Do not log sucessful HTTP requests

Open agourlay opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently every HTTP request processed is logged.

e.g. for successful queries

[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.002239
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.002292
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 89 "-" "k6/0.35.0 (https://k6.io/)" 0.002431
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.002690
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.002295
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 89 "-" "k6/0.35.0 (https://k6.io/)" 0.002778
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.008986
[2022-03-01T15:50:13Z INFO  actix_web::middleware::logger] 127.0.0.1 "PUT /collections/stress_collection/points HTTP/1.1" 200 90 "-" "k6/0.35.0 (https://k6.io/)" 0.002508

Under heavy load this:

  • creates a lot of noise in the logs.
  • generates additional load on the CPU as printing out those logs becomes more expensive (25% of one core on my setup).

Describe the solution you'd like Do not log requests with HTTP status 2xx.

agourlay avatar Mar 01 '22 15:03 agourlay

It seems the feature is currently not supported by actix-web but it does not seem very complex to contribute the change.

agourlay avatar Mar 01 '22 20:03 agourlay

Alternative approach would be to additionally log errors outside of actix_web::middleware::logger, in this case it would be possible to disable request logging with just usual logger configuration

generall avatar May 18 '22 20:05 generall

Currently, we are logging errors explicitly, so it is possible to specifically disable the request logging with env or config file parameter: QDRANT__LOG_LEVEL=INFO,actix_web=WARN. Going to close this issue for now

generall avatar Oct 29 '22 13:10 generall