From 238f252a3a8f6a8a6da4f2a75876cbdf49db39d8 Mon Sep 17 00:00:00 2001 From: Konstantin Kapustin Date: Thu, 6 Sep 2012 11:51:59 +0400 Subject: [PATCH] Fixed output of content_length in access log. --- gunicorn/glogging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index abddda41..182c8a8c 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -164,7 +164,7 @@ class Logger(object): 'r': "%s %s %s" % (environ['REQUEST_METHOD'], environ['RAW_URI'], environ["SERVER_PROTOCOL"]), 's': status, - 'b': str(resp.response_length) or '-', + 'b': resp.response_length and str(resp.response_length) or '-', 'f': environ.get('HTTP_REFERER', '-'), 'a': environ.get('HTTP_USER_AGENT', '-'), 'T': str(request_time.seconds),