I am using twistd
to run my application, and I read how to customize the logger. However, I can't seem to figure out how to get the default logger (-l
option, uses sequential integers for extensions) or the DailyLogFile
to limit the number of rotated logs. I'd ideally like the rotated log files to have date extensions in "%Y-%m-%d" format and be limited to 7 at a time.
I tried using logrotate
on my system, but I found that it inexplicably puts binary data in the log file when it does a copytruncate
.
EDIT: I believe the reason for the binary data may be similar to this answer.