How to rotate log files when running pyapns and twistd
Posted
by
Henrik
on Server Fault
See other posts from Server Fault
or by Henrik
Published on 2014-08-19T07:22:05Z
Indexed on
2014/08/19
10:22 UTC
Read the original article
Hit count: 351
I use pyapns (Iphone push server) which in turn uses twisted (twistd daemon).
twistd daemon produces twistd.log files. It rotates them to twistd.log.1, twistd.log.2 and so on when twistd.log reaches 1MB but it doesn't use logrotate so I guess it's built in.
The problem is that this continues forever and that old log files are never deleted. This eventually fills my disk.
I've tried to use logrotate or similar to rotate the logs, but then I would need to run logrotate very very often since I need to rotate BEFORE twistd.log reaches 1MB. This could happen within a second for all I know depending on how much log is produced.
So how could I logrotate without hacking pyapns/twistd scripts?
© Server Fault or respective owner