decent syslog replacement?

Malcolm Tredinnick malcolm at commsecure.com.au
Tue Jul 31 13:18:57 EDT 2001


On Tue, Jul 31, 2001 at 12:43:11PM -0400, Nicholas Henke wrote:
> Hello, I am in the process of writing a Metakit database wrapper. I am 
> running into performance problems when I try to log a ton of debug 
> messages. The system with thrash the disk when logging. I have tried using 
> syslog, replacing stdout with a file, etc. None of these seem to help much. 
> The only luck I have had is to just use print and have bash redirect to a 
> file. This causes problems in other servers that are trying to log to the 
> same file.

Well, you have just described a number of _different_ problems here (for
example, replacing stdout with a file will not work if you are using
system() or os.pipe() calls).

As far as your original problem goes, syslog attempts to be reliable
even in case of crashes. So, by default, it flushes every message to
disk as it is written.

It is possible to turn off this flushing to disk after each right, by
prepending the filename in /etc/syslog.conf with a '-'. See the
syslog.conf(5) man page for details. Note, however, that this is only
valid for Linux (it was added in the port from BSD sources originally),
but if you aren't running Linux, then there's just not much point to
programming, really. :-)

Cheers,
Malcolm

-- 
The colder the x-ray table, the more of your body is required on it.




More information about the Python-list mailing list