Fix bug DNN-4591: clear exceptions in log files.