From 4f8633375d8a9fdcbc90f02e4204535af4cc6fd1 Mon Sep 17 00:00:00 2001 From: bow Date: Tue, 9 Jan 2018 13:47:01 +0100 Subject: [PATCH] Fix log_response to correctly output request ip and port --- sanic/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/server.py b/sanic/server.py index af6dc62d..e9790dae 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -319,7 +319,8 @@ class HttpProtocol(asyncio.Protocol): extra['host'] = 'UNKNOWN' if self.request is not None: if self.request.ip: - extra['host'] = '{0[0]}:{0[1]}'.format(self.request.ip) + extra['host'] = '{0}:{1}'.format(self.request.ip, + self.request.port) extra['request'] = '{0} {1}'.format(self.request.method, self.request.url)