diff options
Diffstat (limited to 'wsgitools')
-rw-r--r-- | wsgitools/filters.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wsgitools/filters.py b/wsgitools/filters.py index cfa6c36..fbcfe5c 100644 --- a/wsgitools/filters.py +++ b/wsgitools/filters.py @@ -168,6 +168,7 @@ class RequestLogWSGIFilter(BaseWSGIFilter): def filter_environ(self, environ): """BaseWSGIFilter interface""" self.remote = environ.get("REMOTE_ADDR", "?") + self.user = environ.get("REMOTE_USER", "-") self.reqmethod = environ["REQUEST_METHOD"] self.path = environ["SCRIPT_NAME"] + environ["PATH_INFO"] self.proto = environ.get("SERVER_PROTOCOL", None) @@ -184,8 +185,8 @@ class RequestLogWSGIFilter(BaseWSGIFilter): return data def handle_close(self): """BaseWSGIFilter interface""" - line = '%s - - [%s] "%s' % (self.remote, self.time, self.reqmethod) - line = '%s %s' % (line, self.path) + line = '%s %s - [%s]' % (self.remote, self.user, self.time) + line = '%s "%s %s' % (line, self.reqmethod, self.path) if self.proto is not None: line = "%s %s" % (line, self.proto) line = '%s" %s %d' % (line, self.status, self.length) |