#33897 closed New feature (wontfix)

django.request log for all requests

Reported by: Tim Ioannidis Owned by: nobody
Component: HTTP handling Version: 4.0
Severity: Normal Keywords: logging
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Ioannidis)

What's the rationale behind only logging responses with django.request if status code is >= 400? Do you think we could make this a setting that a user can configure?

For me it would be nice if I could use the same logger for all my requests coming from gunicorn but now I'm getting only 4XX, 5XX from django and all requests within gunicorn (ending up with duplicate logs for 4XX & 5XX). I would ideally like to disable gunicorn logging and just capture all requests coming from django directly.

Change History (2)

comment:1 by Tim Ioannidis, 21 months ago

Description: modified (diff)

comment:2 by Mariusz Felisiak, 21 months ago

Component: UtilitiesHTTP handling
Resolution: wontfix
Status: newclosed

What's the rationale behind only logging responses with django.request if status code is >= 400?

As far as I'm aware web server logs are appropriate place for logging all responses. It's not something that must be included in Django itself (see also #12012 and LoggingProposal).

Do you think we could make this a setting that a user can configure?

Creating a new setting is always controversial because we already have plenty of them. Moreover, you can find many 3rd-party packages (e.g. django-request-logging, django-request) that will help you to achieve this. You can also add a custom middleware that will log all responses in the django.request logger.

Note: See TracTickets for help on using tickets.
Back to Top