Python XMLRPC question

prasanna prasanna at ix.netcom.com
Wed Oct 14 21:08:09 EDT 2009


On Oct 13, 1:22 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Tue, 13 Oct 2009 16:55:09 -0300, Falcolas <garri... at gmail.com> escribió:
>
>
>
>
>
> > On Oct 13, 12:47 pm,prasanna<prasa... at ix.netcom.com> wrote:
> >> In using Python's XMLRPC, there is a statement that gets printed on
> >> stdout of the form:
> >>                  localhost - - [12/Oct/2009 23:36:12] "POST /RPC2 HTTP/
> >> 1.0" 200 -
>
> >> Where does this message originate? Can I turn it off, or at least
> >> redirect it into a logging file? I am planning to run the server code
> >> automatically at start up and wouldn't have a terminal window open to
> >> get this message. I guess I could redirect/pipe it to a file, but it
> >> would be more useful I could send it to the same log file that I have
> >> the server writing other messages to.
>
> >> Thanks for any help.
>
> > Looking back through the SimpleXMLRPCServer code, it appears that this
> > happens if the logRequests parameter in the SimpleXMLRPCServer class
> > initialization is set to True, which it is by default. The underlying
> > implementation of the logging is in BaseHTTPServer.py, which uses
> > sys.stderr.
>
> > Looks like the simplest way to change that would be to inherit from
> > the SimpleXMLRPCRequestHandler class and implement your own
> > log_request method. You could then pass that to the SimpleXMLRPCServer
> > constructor.
>
> I think it's easier to pass logRequests=False when creating the server.
>
> --
> Gabriel Genellina

Thanks. That helped get rid of the message.

Out of curiosity--one more thing I haven't yet figured out, is there a
xmlrpc command I can send that stops or restarts the server?

--p



More information about the Python-list mailing list