Log data and save files