* added code to automatically write new log lines to a log file
* needs to be tested but looks ok so far