#27785 closed New feature (duplicate)
Log request.body (or part of it) in the 500 debug content
Reported by: | Claude Paroz | Owned by: | |
---|---|---|---|
Component: | Error reporting | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a use case where a server error happens due to some unexpected content coming from the request.body
content. Unfortunately, the debug view currently doesn't output anything related to request.body
. It should probably be trimmed at some point (4Ko for example), and the ability to filter the output could be added with a new method of ExceptionReporterFilter
. If undecodable, a simple output like <Undecodable bytes>
could be output.
Change History (4)
comment:1 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 5 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
#30752 (Django 3.1) allows providing a custom ExceptionReporter sublcass. That will be the place to add the logic you need.
Maybe we could pull something in to do it by default if you come up with a good solution now that it's customizable, but we have X tickets for Can we add A, or B, or C — so my bias is towards leaving the default as we have it now, rather than trying to accommodate every possible extension.
comment:3 by , 5 years ago
I still think that Django could do better by default here, but fair, let's keep it closed until I (or someone else) come with some possible patch.
comment:4 by , 5 years ago
Agreed. Alwasy happy to look at these things if there’s a patch in play. :)
I wonder if django rest framework does anything related that could be worth borrowing from.