473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SimpleXMLRPCServer -- turning off request log?

mh
My SimpleXMLRPCServer program prints to stderr a line like
this for each request:

ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 -

Is there a way to turn this logging off? I have RTFM and can't
seem to find a way to do so.

Many TIA!
Mark

--
Mark Harrison
Pixar Animation Studios
Sep 26 '08 #1
4 2245
On Sep 25, 6:01*pm, m...@pixar.com wrote:
My SimpleXMLRPCServer program prints to stderr a line like
this for each request:

ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 -

Is there a way to turn this logging off? *I have RTFM and can't
seem to find a way to do so.

Many TIA!
Mark

--
Mark Harrison
Pixar Animation Studios
Im pretty sure there's a more pythonic way, but you could redirect
stdout to /dev/null

import sys
sys.stdout = open("/dev/null", 'w')

assuming you're not on windows...

~Sean
Sep 26 '08 #2
On Sep 25, 9:04*pm, Sean DiZazzo <half.ital...@gmail.comwrote:
On Sep 25, 6:01*pm, m...@pixar.com wrote:
My SimpleXMLRPCServer program prints to stderr a line like
this for each request:
ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 -
Is there a way to turn this logging off? *I have RTFM and can't
seem to find a way to do so.
Many TIA!
Mark
--
Mark Harrison
Pixar Animation Studios

Im pretty sure there's a more pythonic way, but you could redirect
stdout to /dev/null

import sys
sys.stdout = open("/dev/null", 'w')

assuming you're not on windows...

~Sean
Here's the more pythonic version:

# Fake a file handle with the write method
class NullDevice(object):
def write(self, s):
pass

import sys
sys.stdout = NullDevice()

* http://code.activestate.com/recipes/278731/
Comment 1: attributed to Mr. Lundh

~Sean
Sep 26 '08 #3
On Sep 26, 2:01 am, m...@pixar.com wrote:
My SimpleXMLRPCServer program prints to stderr a line like
this for each request:

ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 -

Is there a way to turn thisloggingoff? I have RTFM and can't
seem to find a way to do so.
From the documentation (2.5):

class SimpleXMLRPCServer( addr[, requestHandler[, logRequests[,
allow_none[, encoding]]]])

"If logRequests is true (the default), requests will be logged;
setting this parameter to false will turn off logging."

Did you try setting logRequests to false?

Regards,

Vinay Sajip
Sep 26 '08 #4
mh
Vinay Sajip <vi*********@yahoo.co.ukwrote:
Did you try setting logRequests to false?
Perfect, that's just what I needed.

Thanks Vinay!!
Mark

--
Mark Harrison
Pixar Animation Studios
Oct 3 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marco Aschwanden | last post by:
I would like to develop a server based on python's xmlrpc. But I realized that SimpleXMLRPCServer does not spawn a thread for each request. How could the SimpleXMLRPCServer be turned into a...
9
by: Yannick Turgeon | last post by:
I plan to use XML-RPC to communicate between my python server and VB client. I just called a simple registered function (lambda x,y: x+y) and it worked. But I'm new to XML-RPC and I'm now wondering...
1
by: Chris Spencer | last post by:
I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for remote procedure call. I've written a simple IP based authentication scheme for the Server, and I'd like to include the port in...
0
by: Thomas G. Apostolou | last post by:
Hello all, I use Python 2.3.3 and try to patch SimpleXMLRPCServer.py with the patch i got from Python.org. so after changing to the directory where both SimpleXMLRPCServer.py and...
4
by: stuff | last post by:
Is it possible to obtain the client's ip address from a SimpleXMLRPCServer instance or subclass instance? When running SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out the...
0
by: JDF | last post by:
I am trying to create a Windows service using SimpleXMLRPCServer and win32serviceutil. The service itself seems to be working properly (starts, stops, etc) and I can connect using an XMLRPC client...
0
by: Juju | last post by:
Hi, First, sorry for my poor English ! I used the SimpleXMLRPCServer facility of Python to develop a multithread-server, here's part of my code : -- class...
0
by: Rudy Schockaert | last post by:
After some Googling I found a post of someone who wanted to do exactly as what I want to do now. There is however a problem in his code that makes the service fails after the first connection. I...
3
by: Achim Domma | last post by:
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.