private void LogTraceFailure(string traceString, Exception e) { TimeSpan span = TimeSpan.FromMinutes(10.0); try { lock (this.localSyncObject) { if (DateTime.UtcNow.Subtract(this.LastFailure) >= span) { this.LastFailure = DateTime.UtcNow; System.ServiceModel.Diagnostics.EventLogger logger = System.ServiceModel.Diagnostics.EventLogger.UnsafeCreateEventLogger(this.eventSourceName, this); if (e == null) { logger.UnsafeLogEvent(TraceEventType.Error, EventLogCategory.Tracing, (System.ServiceModel.Diagnostics.EventLogEventId)(-1073676184), false, new string[] { traceString }); } else { logger.UnsafeLogEvent(TraceEventType.Error, EventLogCategory.Tracing, (System.ServiceModel.Diagnostics.EventLogEventId)(-1073676183), false, new string[] { traceString, e.ToString() }); } } } } catch { } }
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; } }
internal void TraceFailFast(string message) { System.ServiceModel.Diagnostics.EventLogger logger = null; try { logger = new System.ServiceModel.Diagnostics.EventLogger(this.eventSourceName, this.diagnosticTrace); } finally { TraceFailFast(message, logger); } }
internal static System.ServiceModel.Diagnostics.EventLogger UnsafeCreateEventLogger(string eventLogSourceName, object diagnosticTrace) { System.ServiceModel.Diagnostics.EventLogger logger = new System.ServiceModel.Diagnostics.EventLogger(); logger.SetLogSourceName(eventLogSourceName, diagnosticTrace); return(logger); }
internal void TraceFailFast(string message) { System.ServiceModel.Diagnostics.EventLogger logger = null; try { logger = new System.ServiceModel.Diagnostics.EventLogger(this.eventSourceName, this.diagnosticTrace); } finally { TraceFailFast(message, logger); } }
internal static System.ServiceModel.Diagnostics.EventLogger UnsafeCreateEventLogger(string eventLogSourceName, object diagnosticTrace) { System.ServiceModel.Diagnostics.EventLogger logger = new System.ServiceModel.Diagnostics.EventLogger(); logger.SetLogSourceName(eventLogSourceName, diagnosticTrace); return logger; }