Comment 2 for bug 589604

Revision history for this message
Robert Collins (lifeless) wrote :

This is a subtle buh - and that fragment is interesting - its basically not safe (no callFromThread) and otherwise the same as the built in twistd setup. (Thanks spiv for analysing this)

twistd -l foo.log
will behave identically except that it will use SIGUSR1 not SIGUSR2 to rotate.

Both twistd and the fragment you pasted use LogFile.fromFullPath, so you get the default rotation behaviour.

The constructor parameter rotateLength when set to None will disable rotation.

See pydoc twisted.python.logfile.LogFile for details.

I think that a small patch to twistd would let us say --rotate=None and disable rotation altogether, which is what we want - that lets us manually rotate at our schedule rather than being forced to stay under 1 MB.

I'm going to request that in the upstream now.