470,811 Members | 1,211 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,811 developers. It's quick & easy.

mod_python and logging

Hi,

I'm looking for a logging module to be used in a mod_python-powered
website. Python 2.3's logging package seems like a good fit, however
I'm not sure if it's completely safe to use it under high load. The
library documentation states that it's thread-safe, but what about
several forked apache processes running different (sub-)interpreters,
logging to the same file?

Other suggestions for logging (I really don't need most of logging.*'s
facilities) are also welcome.

Thanks,
Daniel

--
For mail replies please use my address from
http://perplex.schmumpf.de/
http://www.gametective.de/
Jul 19 '05 #1
3 1730
Hi Daniel,
look at the thread I started ("Modifying a built-in function for
logging purposes").
http://groups.google.it/group/comp.l...e905ff27462d91
There you can find another approach to logging (limited, but specific)
and you can appreciate the point of view of various experts (I am not
one of them!).
Bye.

Jul 19 '05 #2
Daniel Lichtenberger <daniel_usenet <at> yahoo.de> writes:
I'm looking for a logging module to be used in a mod_python-powered
website. Python 2.3's logging package seems like a good fit, however
I'm not sure if it's completely safe to use it under high load. The
library documentation states that it's thread-safe, but what about
several forked apache processes running different (sub-)interpreters,
logging to the same file?
If you want to have multiple processes logging to the same file, the standard
Python logging module does not support interprocess synchronisation directly.
However, it is fairly easy to set up the processes to log events to a socket,
and a socket receiver can log received events to file. The online docs have an
example socket receiver:

http://docs.python.org/lib/network-logging.html
Other suggestions for logging (I really don't need most of logging.*'s
facilities) are also welcome.


Are you sure you'll never need them in the future?
Vinay Sajip

Jul 19 '05 #3
Hi!

Vinay Sajip wrote:
If you want to have multiple processes logging to the same file, the
standard Python logging module does not support interprocess
synchronisation directly. However, it is fairly easy to set up the
processes to log events to a socket, and a socket receiver can log
received events to file. The online docs have an example socket
receiver:

http://docs.python.org/lib/network-logging.html


Thanks for the suggestion! Of course it's great to have a powerful and
flexible logging package, and it's still pretty easy to use.

Daniel

--
For mail replies please use my address from
http://perplex.schmumpf.de/
http://www.gametective.de/
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by wolf | last post: by
2 posts views Thread by Robert J. Hansen | last post: by
reply views Thread by Python_it | last post: by
6 posts views Thread by Anthony L. | last post: by
1 post views Thread by treelife | last post: by
2 posts views Thread by exhuma.twn | last post: by
5 posts views Thread by m.banaouas | last post: by
3 posts views Thread by Michael | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.