Exemplo n.º 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) }
            };
        }
Exemplo n.º 2
0
 public static void WriteDiagnostic(SLogDetails diagnosticLogDetails)
 {
     _diagnosticLogger.Write(LogEventLevel.Information, "{@SLogDetails}", diagnosticLogDetails);
 }
Exemplo n.º 3
0
 public static void WriteUsage(SLogDetails usageLogDetails)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@SLogDetails}", usageLogDetails);
 }
Exemplo n.º 4
0
 public static void WriteError(SLogDetails errorLogDetails)
 {
     _errorLogger.Write(LogEventLevel.Error, "{@SLogDetails}", errorLogDetails);
 }
Exemplo n.º 5
0
 public static void WritePerformance(SLogDetails performanceLogDetails)
 {
     _performanceLogger.Write(LogEventLevel.Information, "{@SLogDetails}", performanceLogDetails);
 }