Periodically flush log.