logger.addHandler(memHandler)
fileHandler = logging.FileHandler(conf.get('main', 'log_file'), 'w')
memHandler.setTarget(fileHandler)
memHandler.flush()
memHandler.close()
logger.removeHandler(memHandler)
logger.addHandler(fileHandler)
Including previously logged events in a new logging handler