Fix log file create and append logs