Beispiel #1
0
 public static void ReportException(Exception e, BaseEvent eventInst)
 {
     m_ErrorsOccurred++;
       if (m_ErrorsOccurred <= m_MaxErrors)
       {
     try
     {
       EventLog.WriteEntry("BaseEvent.ReportException()",
                       string.Format("Event type: '{0}' \n{1}\nEvent caller trace:\n{2}",
                                     (eventInst == null) ? "unknown" : eventInst.GetType().ToString(),
                                     e.ToString(), Environment.StackTrace), EventLogEntryType.Error);
     }
     catch
     {
       Trace.WriteLine(e.ToString());
     }
       }
 }