Log files are now written to a temp directory

Log files are written to a temporary directory and subsequently deleted.