Esempio n. 1
0
 /// <summary>
 /// Pushes the logging stats to the Push Log Queue, used for file logging.
 /// </summary>
 private void PushLoggingStats()
 {
     // Create a nice Data message for File Based Logging.
     PushInfo("Start Time", StaticApplicationLoggingMetrics.StartTime.ToString());
     if (!StaticApplicationLoggingMetrics.EndTime.HasValue)
     {
         StaticApplicationLoggingMetrics.EndTime = DateTime.Now;
     }
     PushInfo("End Time", StaticApplicationLoggingMetrics.EndTime.Value.ToString());
     PushInfo("Total Time", StaticApplicationLoggingMetrics.TotalTime().ToString());
     PushInfo("Fatal Log Count", StaticApplicationLoggingMetrics.FatalCount.ToString());
     PushInfo("Error Log Count", StaticApplicationLoggingMetrics.ErrorCount.ToString());
     PushInfo("Warn Log Count", StaticApplicationLoggingMetrics.WarnCount.ToString());
     PushInfo("Info Log Count", StaticApplicationLoggingMetrics.InfoCount.ToString());
     PushInfo("Debug Log Count", StaticApplicationLoggingMetrics.DebugCount.ToString());
     PushInfo("Trace Log Count", StaticApplicationLoggingMetrics.TraceCount.ToString());
 }
Esempio n. 2
0
 protected sealed override void SetCustomProperties(Dictionary <string, object> customProperties)
 {
     // Set the properties for centralized logging.
     customProperties["startTime"] = StaticApplicationLoggingMetrics.StartTime.ToString();
     if (StaticApplicationLoggingMetrics.EndTime.HasValue)
     {
         customProperties["endTime"] = StaticApplicationLoggingMetrics.EndTime.Value.ToString();
     }
     customProperties["executionTimeMinutes"] = StaticApplicationLoggingMetrics.TotalTime().TotalMinutes;
     customProperties["executionTimeMS"]      = StaticApplicationLoggingMetrics.TotalTime().Milliseconds;
     customProperties["fatalLogCount"]        = StaticApplicationLoggingMetrics.FatalCount;
     customProperties["errorLogCount"]        = StaticApplicationLoggingMetrics.ErrorCount;
     customProperties["warnLogCount"]         = StaticApplicationLoggingMetrics.WarnCount;
     customProperties["infoLogCount"]         = StaticApplicationLoggingMetrics.InfoCount;
     customProperties["debugLogCount"]        = StaticApplicationLoggingMetrics.DebugCount;
     customProperties["traceLogCount"]        = StaticApplicationLoggingMetrics.TraceCount;
     SetDerivedClassCustomProperties(customProperties);
 }