I currently have twisted managing rotating the log files for my application, however the logs are becoming large and I’d like to look at compressing them when they rotate.
I’ve done a quick look through the twisted docs and don’t see how I can do this with the DailyLogFile class.
My setup for logging is:
from twisted.python.log import ILogObserver, FileLogObserver
from twisted.python.logfile import DailyLogFile
...
"Setup the logging"
logPath = os.getcwd() + "/logs/"
logFile = DailyLogFile("lazarus.log", logPath, defaultMode=0644)
application.setComponent(ILogObserver, FileLogObserver(logFile).emit)
Does anyone know how to do this?
You could subclass
DailyLogFileand overload therotatemethod: