[Twisted-Python] XMLRPC, how to prevent stdout on post and get?

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jul 19 07:37:28 EDT 2011


On 07:37 am, happybrowndog at hotmail.com wrote:
>I have a simple xmlrpc server written using Twisted.  Every time I get 
>a
>request to it, stdout spits out something like the following:
>
>2011-07-19 00:33:39-0700 [HTTPChannel,332,127.0.0.1] 127.0.0.1 - -
>[19/Jul/2011:07:33:38 +0000] "POST / HTTP/1.0" 200 128 "-"
>"xmlrpclib.py/1.0.1 (by www.pythonware.com)"
>
>
>How do I prevent this from happening?  I also do not want this going to
>a log file either.
>
>Thanks anybody for your help!

If not for the logfile rotation that twisted.web.server.Site wants to 
do, you could pass os.devnull as a logPath to Site's initializer. 
However, log rotation will like causes this to do something bad.

There's a private method that Site overrides (from HTTPFactory) that 
controls part of this behavior.  It might be useful to have a public API 
for that instead.

Would you like to file an enhancement ticket in the issue tracker 
describing the use case?

Jean-Paul



More information about the Twisted-Python mailing list