Changes between Initial Version and Version 1 of Ticket #26688
- Timestamp:
- May 30, 2016, 10:21:58 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26688 – Description
initial v1 5 5 The actual behaviour is not quite consistent with this: 6 6 7 - Only `4 04` and `500` responses are logged to `django.request` - not any other responses in the `4xx` and`5xx` range.7 - Only `4xx` and `500` responses are logged to `django.request` - not any other responses in the `5xx` range. 8 8 9 9 - `500` responses are only logged if they are the result of an uncaught exception. The logging happens in `django.core.handlers.base.handle_uncaught_exception`. If a view manually sets a `500` response somewhere, this isn't logged. … … 11 11 - The same was true of `404` responses (they were only logged if an uncaught `Http404` was raised), until the change made in ticket:26504 inadvertently altered this behaviour. After that change, all `404`s are logged regardless of how they are generated. 12 12 13 - Other `4xx` responses meanwhile are only logged as the result of an exception (`PermissionDenied` etc.), not if the status code is set manually. 14 15 - `400` responses are logged to `django.security` but not to `django.request`. 16 13 17 I would be happy to submit a patch that addresses this but would like some guidance on what the best solution is. My initial thoughts are: 14 18 15 19 - I think Django should log all `5xx` responses, regardless of how they were generated. This would mean refactoring the logic that does this logging. 16 20 17 - Either log all `4xx` responses or change the documentation to say that only `404`s are logged.21 - Either log all `4xx` responses to `django.request` or change the documentation to list what specific responses are logged.