rikardhul...@gmail.com writes: > I use logging.FileHandler (on windows) and I would like to be able to delete > the file while the process is running and have it create the file again on > next log event. > > On windows (not tried linux) this is not possible because the file is locked > by the process, can I get it to close the file after each log event? > > If not, would the correct thing to do be to write my own LogHandler with this > behavior?
Zope is using Python's "logging" module and wants to play well with log rotating (start a new logfile, do something with the old log file (compress, rename, remove)). It does this by registering a signal handler which closes its logfiles when the corresponding signal is received. Maybe, you can do something like this. Signal handling under Windows is limited, but maybe you find a usable signal under Windows (Zope is using "SIGUSR1"). -- http://mail.python.org/mailman/listinfo/python-list