flush logdata every 3 seconds and before close