writing log and csv files to temp directory to delete later.