Exemple #1
0
 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);
 }
Exemple #2
0
 public static void TraceError(string message, string className)
 {
     GlobalTracer.Instance.Error(message, GlobalTracer.GetClassName());
 }
Exemple #3
0
 public static void TraceErrorFormat(string format, params object[] args)
 {
     GlobalTracer.TraceError(string.Format(format, args));
 }
Exemple #4
0
 public static void TraceWarning(string message)
 {
     GlobalTracer.Instance.Warning(message, GlobalTracer.GetClassName());
 }
Exemple #5
0
 public static void TraceInfo(string message)
 {
     GlobalTracer.Instance.Info(message, GlobalTracer.GetClassName());
 }
Exemple #6
0
 public static void TraceVerbose(string message)
 {
     GlobalTracer.Instance.Verbose(message, GlobalTracer.GetClassName());
 }
Exemple #7
0
 public static void TraceVerboseFormat(string format, params object[] args)
 {
     GlobalTracer.TraceVerbose(string.Format(format, args));
 }