This fixes a typo in CVS and adds a common handler for file logging:

Index: Twisted/twisted/web2/log.py
===================================================================
--- Twisted/twisted/web2/log.py (revision 15644)
+++ Twisted/twisted/web2/log.py (working copy)
@@ -137,7 +137,7 @@
         request = eventDict['request']
         response = eventDict['response']
         loginfo = eventDict['loginfo']
-        firstLine = '%s %s HTTP/%' %(
+        firstLine = '%s %s HTTP/%s' %(
             request.method,
             request.uri,
             '.'.join([str(x) for x in request.clientproto]))
@@ -166,6 +166,13 @@
         tlog.removeObserver(self.emit)
 
 
+class FileAccessLoggingObserver(BaseCommonAccessLoggingObserver):
+       def __init__(self, logpath):
+               self.f = file(logpath, 'a', 1)
+
+       def logMessage(self, message):
+               self.f.write(message + '\n')
+
 class DefaultCommonAccessLoggingObserver(BaseCommonAccessLoggingObserver):
     """Log requests to default twisted logfile."""
     def logMessage(self, message):

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to