[Twisted-Python] Re: log rotation
slyphon at twistedmatrix.com
Tue Sep 21 14:06:23 EDT 2004
Tsai Li Ming wrote:
> exarkun at divmod.com wrote:
>> On Tue, 21 Sep 2004 11:14:38 +0800, Tsai Li Ming
>> <mailinglist at ltsai.com> wrote:
>>> Has anyone used logrotate or simple use a cron job to send a SIGUSR1
>>> to the process?
>>> If I understand the twistd man page properly, the log file will be
>>> rotated on SIGUSR1, therefore I'm wont be able to use logrotate to
>>> do the rotation?
>> logrotate should rotate twistd logfiles just fine. It shuts down a
>> process, moves its log files around, then restarts it.
>> Why you'd _want_ to rotate them this way, instead of just letting
>> them automatically be rotated by twistd (which they will be), I
>> dunno. Is there some feature logrotate has that twistd lacks that
>> you're interested in?
> When you say twisted will automatically rotate the log files, how does
> it do that? Will it automatically rotate the log files periodically?
yes, in twisted.python.logfile.LogFile there is an option to __init__
'rotateLength' that is by default 1000000. So at 100000 bytes, it will
rotate the file.
More information about the Twisted-Python