Added logging to csv file.