[Twisted-Python] Controlling logging in xmlrpc server

Don Dwiggins ddwiggins at advpubtech.com
Fri Aug 29 12:12:24 EDT 2008

I have an XMLRPC server running nicely, and have set up logging to a 
file using t.p.log (mainly for debugging).  It all works fine, but I'm 
getting entries in the log like the following:

2008/08/28 16:44 -0700 [HTTPChannel,0,] - - 
[28/Aug/2008:23:44:02 +0000] "POST / HTTP/1.1" 200 683 "-" 

(all one line -- excuse the folding).

I'd like to be able to control this: disable these log messages when I 
want, log additional information about the request, etc.  (In 
particular, I'd like to see the xmlrpc "method" name.)

I've tracked down the source of the messages to HTTPFactory.log in 
t.w.http.py.  At this point, I'm not sure how to proceed.  I don't use 
the factory explicitly, just instantiate a subclass of xmlrpc.XMLRPC, 
wrap it in a server.Site and pass it to the default reactor.  What would 
I need to do to access the HTTPFactory (or maybe subclass it) in this 
context?  Is there a better approach to this?

Don Dwiggins
Advanced Publishing Technology

More information about the Twisted-Python mailing list