sync log file
put file in db after write