[Django] #27785: Log request.body (or part of it) in the 500 debug content

16 views
Skip to first unread message

Django

unread,
Jan 27, 2017, 9:50:31 AM1/27/17
to django-...@googlegroups.com
#27785: Log request.body (or part of it) in the 500 debug content
-------------------------------------------+------------------------
Reporter: Claude Paroz | Owner: (none)
Type: New feature | Status: new
Component: Error reporting | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27785>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 27, 2017, 7:55:15 PM1/27/17
to django-...@googlegroups.com
#27785: Log request.body (or part of it) in the 500 debug content
---------------------------------+------------------------------------

Reporter: Claude Paroz | Owner: (none)
Type: New feature | Status: new
Component: Error reporting | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

I wonder if django rest framework does anything related that could be
worth borrowing from.

--
Ticket URL: <https://code.djangoproject.com/ticket/27785#comment:1>

Django

unread,
Jan 16, 2020, 9:39:57 AM1/16/20
to django-...@googlegroups.com
#27785: Log request.body (or part of it) in the 500 debug content
---------------------------------+-------------------------------------

Reporter: Claude Paroz | Owner: (none)
Type: New feature | Status: closed

Component: Error reporting | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => duplicate


Comment:

#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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27785#comment:2>

Django

unread,
Jan 16, 2020, 3:16:40 PM1/16/20
to django-...@googlegroups.com
#27785: Log request.body (or part of it) in the 500 debug content
---------------------------------+-------------------------------------

Reporter: Claude Paroz | Owner: (none)
Type: New feature | Status: closed

Component: Error reporting | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------

Comment (by Claude Paroz):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27785#comment:3>

Django

unread,
Jan 17, 2020, 5:18:18 AM1/17/20
to django-...@googlegroups.com
#27785: Log request.body (or part of it) in the 500 debug content
---------------------------------+-------------------------------------

Reporter: Claude Paroz | Owner: (none)
Type: New feature | Status: closed

Component: Error reporting | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Agreed. Alwasy happy to look at these things if there’s a patch in play.
:)

--
Ticket URL: <https://code.djangoproject.com/ticket/27785#comment:4>

Reply all
Reply to author
Forward
0 new messages