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