mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Use sent instead of response_length in access log
Previously, resp.response_length is used for the b atom of the access log formatter. If the application does not set a content-length header, response_length is left as `None`, resulting in b being set to the fallback "-". resp.sent is a more reliable way to determine the number of bytes in the response body.
This commit is contained in:
parent
783984cabd
commit
71f7d353f0
@ -243,7 +243,7 @@ class Logger(object):
|
||||
'r': "%s %s %s" % (environ['REQUEST_METHOD'],
|
||||
environ['RAW_URI'], environ["SERVER_PROTOCOL"]),
|
||||
's': status,
|
||||
'b': resp.response_length and str(resp.response_length) or '-',
|
||||
'b': resp.sent and str(resp.sent) or '-',
|
||||
'f': environ.get('HTTP_REFERER', '-'),
|
||||
'a': environ.get('HTTP_USER_AGENT', '-'),
|
||||
'T': request_time.seconds,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user