[Twisted-Python] twistd logging rotation and discarding logs

Jp Calderone exarkun at intarweb.us
Mon Dec 8 13:26:48 EST 2003

On Mon, Dec 08, 2003 at 10:49:48AM -0500, rahul at reno.cis.upenn.edu wrote:
> Hi Folks,
> twistd has a very nice logging feature which seems on my machine to
> totate log files every 1mb. After a while though many log files pile up.
> I looked in twisted.python.log for options to discard older files, and also
> on google, but wasnt sure how to interact with twistd's logging. Is there
> a way of doing this at the twistd level, or should I just use cron or
> implement custom logging using twistd.python.log and logfile?
> Thanks,
> Rahul

  Log rotation is handled by twisted.python.logfile.LogFile.rotate().  If
you wanted to discard older logs, you would probably subclass LogFile,
override rotate, and then install your LogFile instead of the default

  The last step will probably be somewhat tricky.  I don't think twistd
lets you specify the LogFile class to use (though perhaps it should).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031208/72a3366d/attachment.pgp 

More information about the Twisted-Python mailing list