private void ManageException(Tuple <string, Exception> tuple) { try { if (tuple == null) { return; } var ex = tuple.Item2; while (ex != null) { var exceptionModel = BuildExceptionModel(tuple); lock (ExceptionModel) { if (ExceptionModel.Count > 100) { ExceptionModel.Clear(); } ExceptionModel.Add(exceptionModel); } log.Error(exceptionModel.Target, tuple.Item2); ex = ex.InnerException; if (ex != null) { tuple = Tuple.Create <string, Exception>(ex.Source, ex); } } } catch (Exception e) { log.Error("未处理的严重异常", e); } }