public static void TraceError(string message) { GlobalTracer.Instance.Error(message, GlobalTracer.GetClassName()); if (!GlobalConfiguration.GetBoolean("LogErrorsToEventLog")) return; string source = GlobalConfiguration.AppSettings["EventLogSource"]; if (string.IsNullOrEmpty(source)) source = ".NET Runtime"; try { if (!EventLog.SourceExists(source)) EventLog.CreateEventSource(new EventSourceCreationData(source, GlobalTracer.GetLogName())); } catch (Exception ex) { source = ".NET Runtime"; } EventLog.WriteEntry(source, string.Format("{0} ({1})", (object)message, (object)GlobalTracer.GetClassName()), EventLogEntryType.Error, 1026); }
public static void TraceError(string message, string className) { GlobalTracer.Instance.Error(message, GlobalTracer.GetClassName()); }
public static void TraceErrorFormat(string format, params object[] args) { GlobalTracer.TraceError(string.Format(format, args)); }
public static void TraceWarning(string message) { GlobalTracer.Instance.Warning(message, GlobalTracer.GetClassName()); }
public static void TraceInfo(string message) { GlobalTracer.Instance.Info(message, GlobalTracer.GetClassName()); }
public static void TraceVerbose(string message) { GlobalTracer.Instance.Verbose(message, GlobalTracer.GetClassName()); }
public static void TraceVerboseFormat(string format, params object[] args) { GlobalTracer.TraceVerbose(string.Format(format, args)); }