Added option to log the training model errors.