django
django copied to clipboard
Fixed #25704 -- Added response time in runserver logs.
Override log_request
as log_request
is called by log_response
and format the message to include time for request completion plus some WSGI server overhead.
@tushar5526 Nice work! I think this will need a test before it can be merged though.
For other readers, here's a link to the ticket: https://code.djangoproject.com/ticket/25704
@LilyFoote I have updated the tests. Will it be a good idea to convert the response time from ms
to seconds (s)
if the response time >= 1 second
?
If it doesn't complicate the code too much, that sounds like a nice quality of life improvement.
Hi @tushar5526 👋 great to see you!
Can you add to the django.server
logging docs that response time is also included (https://docs.djangoproject.com/en/dev/ref/logging/#django-server). It will also need a .. versionchanged:: 5.1
note and a mention in the 5.1 release notes 👍
Hey @sarahboyce :) I have added the required doc changes. Thanks for reviewing!