I have a python program that is writing to a log file that is being rotated by Linux\'s logrotate command. When this happens I need to signal my program to stop writing to
from logging import handlers handler = handlers.TimedRotatingFileHandler(filename, when=LOG_ROTATE) handler.setFormatter(logging.Formatter(log_format, datefmt="%d-%m-%Y %H:%M:%S")) #LOG_ROTATE = midnight #set your log format
This should help you in handling rotating log