protect the log file better from too many writes