Beispiel #1
0
        public PerformanceTracker(string name,
                                  string userId, string username,
                                  string location, string product,
                                  string layer)
        {
            _stopwatch = Stopwatch.StartNew();

            _logDetails = new SLogDetails()
            {
                Message  = name,
                UserId   = userId,
                Username = username,
                Product  = product,
                Layer    = layer,
                Location = location,
                HostName = Environment.MachineName
            };

            var beginTime = DateTime.UtcNow;

            _logDetails.AdditionalInfo = new Dictionary <string, object>()
            {
                { "Started", beginTime.ToString(CultureInfo.InvariantCulture) }
            };
        }
Beispiel #2
0
 public static void WriteDiagnostic(SLogDetails diagnosticLogDetails)
 {
     _diagnosticLogger.Write(LogEventLevel.Information, "{@SLogDetails}", diagnosticLogDetails);
 }
Beispiel #3
0
 public static void WriteUsage(SLogDetails usageLogDetails)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@SLogDetails}", usageLogDetails);
 }
Beispiel #4
0
 public static void WriteError(SLogDetails errorLogDetails)
 {
     _errorLogger.Write(LogEventLevel.Error, "{@SLogDetails}", errorLogDetails);
 }
Beispiel #5
0
 public static void WritePerformance(SLogDetails performanceLogDetails)
 {
     _performanceLogger.Write(LogEventLevel.Information, "{@SLogDetails}", performanceLogDetails);
 }