Example #1
0
 internal static void TraceFailFast(string message, System.Runtime.Diagnostics.EventLogger logger)
 {
     try
     {
         if (logger != null)
         {
             string stackTrace = null;
             try
             {
                 stackTrace = new StackTrace().ToString();
             }
             catch (Exception exception)
             {
                 stackTrace = exception.Message;
             }
             finally
             {
                 logger.LogEvent(TraceEventType.Critical,
                     (ushort)EventLogCategory.FailFast,
                     (uint)EventLogEventId.FailFast,
                     message,
                     stackTrace);
             }
         }
     }
     catch (Exception e)
     {
         if (logger != null)
         {
             logger.LogEvent(TraceEventType.Critical,
                 (ushort)EventLogCategory.FailFast,
                 (uint)EventLogEventId.FailFastException,
                 e.ToString());
         }
         throw;
     }
 }
 internal static void TraceFailFast(string message, System.ServiceModel.Diagnostics.EventLogger logger)
 {
     try
     {
         if (logger != null)
         {
             string str = null;
             try
             {
                 str = new StackTrace().ToString();
             }
             catch (Exception exception)
             {
                 str = exception.Message;
             }
             finally
             {
                 logger.LogEvent(TraceEventType.Critical, EventLogCategory.FailFast, (System.ServiceModel.Diagnostics.EventLogEventId) (-1073676186), new string[] { message, str });
             }
         }
     }
     catch (Exception exception2)
     {
         if (logger != null)
         {
             logger.LogEvent(TraceEventType.Critical, EventLogCategory.FailFast, (System.ServiceModel.Diagnostics.EventLogEventId) (-1073676185), new string[] { exception2.ToString() });
         }
         throw;
     }
 }