Adds logging to a CSV file