'Close and reopen all file handlers.'

def reopen_files(self):

    for log in (self.error_log, self.access_log):
        for h in log.handlers:
            if isinstance(h, logging.FileHandler):
                h.acquire()
                h.stream.close()
                h.stream = open(h.baseFilename, h.mode)
                h.release()
