Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public static void TraceError(string message, string className)
 {
     GlobalTracer.Instance.Error(message, GlobalTracer.GetClassName());
 }
Ejemplo n.º 3
0
 public static void TraceInfo(string message)
 {
     GlobalTracer.Instance.Info(message, GlobalTracer.GetClassName());
 }
Ejemplo n.º 4
0
 public static void TraceWarning(string message)
 {
     GlobalTracer.Instance.Warning(message, GlobalTracer.GetClassName());
 }
Ejemplo n.º 5
0
 public static void TraceVerbose(string message)
 {
     GlobalTracer.Instance.Verbose(message, GlobalTracer.GetClassName());
 }