예제 #1
0
 /// <summary>
 /// This method logs an event to the appropriate log according to the current 
 /// logging configuration.
 /// </summary>
 /// <param name="entry">LogData entry</param>
 public static void Log(DiagnosticsLogItem entry)
 {
     if (!s_Settings.Enabled) return;
     foreach (var route in s_Settings.Routes
         .Where(route => route.Enabled).Where(route => route.MatchesFilters(entry) 
             && route.DiagnosticsLogger.Instance != null))
     {
         route.DiagnosticsLogger.Instance.Log(entry);
     }
 }
예제 #2
0
 /// <summary>
 /// Traces the specified message
 /// </summary>
 /// <param name="message">Message to trace</param>
 public static void Trace(string message)
 {
     var logItem = new DiagnosticsLogItem
         {
             DetailedMessage = message,
             InstanceName = "",
             Message = "Trace Info",
             ServerName = AppConfigurationManager.GetMachineName(),
             Source = "DiagnosticsManager",
             TenantId = "<none>",
             Timestamp = AppConfigurationManager.GetCurrentDateTimeUtc(),
             ThreadId = 0,
             Type = DiagnosticsLogItemType.Trace
         };
     Log(logItem);
 }