Added logging. (so far only to file)