formatter:
{{{
'%(asctime)s %(levelname)5.5s [%(name)40.40s]'
' (proc.%(process)5.5d) %(funcName)s():%(lineno)d'
' HTTP %(status_code)d REQUEST %(request)s')
}}}
{{{
2015-11-16 13:45:55,579 ERROR [ django.request]
(proc.07627) handle_uncaught_exception():256 HTTP 500 REQUEST
<WSGIRequest: GET '/app/error_page/'>
Traceback (most recent call last):...
}}}
str or repr(request) is missing, GET, POST, COOKIES and META
--
Ticket URL: <https://code.djangoproject.com/ticket/25763>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
This is an intentional change in #12098 and documented in the 1.8 release
notes.
Any ideas about how we can improve the situation are welcome, but I don't
think we're going to revert that patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/25763#comment:1>
Comment (by atarkowska):
Tim is it not what logging formatting is for?
class HttpRequest(object):
{{{
def __repr__(self):
return build_request_repr(self)
def __str__(self):
if self.method is None or not self.get_full_path():
return force_str('<%s>' % self.__class__.__name__)
return force_str(
'<%s: %s %r>' % (self.__class__.__name__, self.method,
force_str(self.get_full_path()))
)
}}}
logging formatter
{{{
' HTTP %(status_code)d %(request)r'
}}}
{{{
<WSGIRequest: GET '/webapp/error_page/'>
[16/Nov/2015 16:29:46] "GET /webapp/error_page/ HTTP/1.1" 200 8366
}}}
works for me
I will create a patch for that
--
Ticket URL: <https://code.djangoproject.com/ticket/25763#comment:2>
Comment (by timgraham):
`build_request_repr()` was removed in #25099. It solved some security
headaches like #22990. I think we want to promote ways of request logging
that avoid things like raw passwords in logs.
--
Ticket URL: <https://code.djangoproject.com/ticket/25763#comment:3>
* status: new => closed
* resolution: => wontfix
Comment:
I think you should be able to write a custom logging handler similar to
`AdminEmailHandler` which uses `record.request` to format the request data
any way you like. This might be something we'd consider for inclusion in
Django itself, although since no one has complained until seven months
after the release of Django 1.8, I guess it's not a popular use case. Feel
free to raise the issue on the DevelopersMailingList if you feel my
analysis is off-base. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/25763#comment:4>