Can I get logging.FileHandler to close the file on each emit?

rikardhulten at gmail.com rikardhulten at gmail.com
Wed Aug 29 06:18:45 EDT 2012


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?

/ Rikard



More information about the Python-list mailing list