Console logging/output for DocXMLRPCServer

sameer_deshpande sameer_deshpande at hotmail.com
Wed Jul 13 13:33:40 CEST 2005


Hello,

I have written simple code using DocXMLRPCServer. How do I log method
name on the console after invoking registered
method on server. On the console it just prints message as [hostname -
date/time and "POST /RPC2 HTTP/1.0" 200 -]

code is:

from DocXMLRPCServer import DocXMLRPCServer

def Test(dummy):
    print dummy
    return 1


if __name__ == '__main__':
    server = DocXMLRPCServer(("", 8000, logRequests = 1))
    server.register_function(Test)
    server.serve_forever()

-----------------

>>> import xmlrpclib
>>> s = xmlrpclib.Server("http://localhost:8000")
>>> s.Test("Hello")

Output of console after invoking method Test is:

hostname - - [13/Jul/2005 13:28:04] "POST /RPC2 HTTP/1.0" 200 -


Thanks

Sameer




More information about the Python-list mailing list