Added logging to a text file