Incorporating logging to text file.