Duplication in API logging #3237
Labels
🤖 aspect: dx
Concerns developers' experience with the codebase
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
good first issue
New-contributor friendly
help wanted
Open to participation from the community
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: api
Related to the Django API
🐍 tech: python
Involves Python
Problem
In the django container logs, we also have two very similar logs for one request. The main difference I see between them is the lack of request id in one of them, so I'm not sure if it's possible to combine them:
| [2023-10-03 15:15:09,480 - gunicorn.access - 363][INFO] 127.0.0.1 - - [03/Oct/2023:15:15:09 +0000] "GET /v1/audio/2ecd1fbf-8122-47e8-84db-50c8ce19c04a/ HTTP/1.0" 200 1682 "-" "Openverse/0.1 (https://openverse.org; openverse@wordpress.org)" | task_id | django
| [2023-10-03 15:15:09,479 - log_request_id.middleware - 55][INFO] <task_id> method=GET path=/v1/audio/2ecd1fbf-8122-47e8-84db-50c8ce19c04a/ status=200
We should probably silence the gunicorn access log because it logs the same information as the log_request_id.middleware, but it doesn't have access to the request id.
Description
Disable uvicorn's access logging by setting
no_access_log=True
inapi/run.py
in the call to start uvicorn.The text was updated successfully, but these errors were encountered: