Opened 2 years ago
Closed 2 years ago
#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 )
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 , 2 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
Component: | Utilities → HTTP handling |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
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).
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 thedjango.request
logger.