Updating logfile2 to use a cache to batch the disk writes, increasing performance.