Feb. 8, 2007
1:31 p.m.
Le jeudi 08 février 2007 à 12:14 +0000, Martin Evans a écrit :
Are there any samples on how best to interact with logging?
My server needs to log quite a few items, as such the log file is growing quite quickly and I would like to be able to switch file names on a daily basis. I would also probably then wish to delete logs older than 14 days.
You could use Python's standard logging module, it has a TimedRotatingFileHandler which seems to do exactly what you want: http://docs.python.org/lib/node414.html Regards