summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2007-04-21 20:46:47 +0200
committerHelmut Grohne <helmut@subdivi.de>2007-04-21 20:46:47 +0200
commit28b2bfd44eddd042d2c68be7bd7f534575803d7a (patch)
tree531d66b930b23d2e679d373ae82d0e657b14039d
parent92056d0256fa7ce364602f0c97496f492b61cd59 (diff)
downloadwsgitools-28b2bfd44eddd042d2c68be7bd7f534575803d7a.tar.gz
added REMOTE_USER to RequestLogWSGIFilter logging
-rw-r--r--wsgitools/filters.py5
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)