tags:

views:

40

answers:

1

I am running an xml-rpc server using SimpleXMLRPCServer from the stdlib.

My code looks something like this:

import SimpleXMLRPCServer
import socket

class RemoteStarter:
    def start(self):
        return 'foo'

rs = RemoteStarter()
host = socket.gethostbyaddr(socket.gethostname())[0]
port = 9000
server = SimpleXMLRPCServer.SimpleXMLRPCServer((host, port))
server.register_instance(rs)
server.serve_forever()

every time the 'start' method gets called remotely, the server prints an access line like this:

<server_name> - - [10/Mar/2010 13:06:20] "POST /RPC2 HTTP/1.0" 200 -

I can't figure out a way to silence the output so it doesn't print these access lines to stdout.

anyone?

+2  A: 

the answer is:

pass logRequests=False to SimpleXMLRPCServer when you create it:

server = SimpleXMLRPCServer.SimpleXMLRPCServer((host, port), logRequests=False)
Corey Goldberg