Added option to log compilation exceptions to a text file. #418