switchinglogfilehandlers/README.md

602 B

TimeoutSwitchingFileHandler

This is a logging file handler for the Python logging system. It automatically closes the log file after a period of inactivity (or after the file has been open for some time whichever comes first) and then opens a new file at the next emit.

This is useful for long-running processes where short periods of activity alternate with periods of inactivity. Log switchs will typically occur during inactivity, so each log file will include one complete active period. Also, since the log files are closed, they can be safely compressed or removed.