requests_wrapper: log the real URL (#35353)
This commit is contained in:
parent
ff6878c39d
commit
eb8674866a
|
@ -138,9 +138,9 @@ class Requests(RequestsSession):
|
||||||
if django_request:
|
if django_request:
|
||||||
extra['request'] = django_request
|
extra['request'] = django_request
|
||||||
if log_errors == 'warn':
|
if log_errors == 'warn':
|
||||||
logging.warning('failed to %s %s (%s)', method, url, response.status_code, extra=extra)
|
logging.warning('failed to %s %s (%s)', method, response.request.url, response.status_code, extra=extra)
|
||||||
else:
|
else:
|
||||||
logging.error('failed to %s %s (%s)', method, url, response.status_code, extra=extra)
|
logging.error('failed to %s %s (%s)', method, response.request.url, response.status_code, extra=extra)
|
||||||
if method == 'GET' and cache_duration and (response.status_code // 100 == 2):
|
if method == 'GET' and cache_duration and (response.status_code // 100 == 2):
|
||||||
cache.set(cache_key, response.content, cache_duration)
|
cache.set(cache_key, response.content, cache_duration)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue