Added logging

A logfile.txt will appear in Documents directory.