예제 #1
0
        public static void WriteDiagnostics(SLogDetail info)
        {
            var showDiagnostics = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("EnableDiagnostics"));

            if (!showDiagnostics)
            {
                return;
            }

            _diagnosticLogger.Write(LogEventLevel.Information, "{@FlogDetail}", info);
        }
예제 #2
0
        public PerfTracker(string name, string userId, string userName, string location, string product, string layer)
        {
            _watch  = new Stopwatch();
            _detail = new SLogDetail()
            {
                Message  = name,
                UserId   = userId,
                UserName = userName,
                Location = location,
                Product  = product,
                Layer    = layer,
                Hostname = Environment.MachineName
            };
            var beginTime = DateTime.Now;

            _detail.AdditionalInfo = new Dictionary <string, object>()
            {
                { "Started", beginTime.ToString(CultureInfo.InvariantCulture) }
            };
        }
예제 #3
0
 public static void WriteUsage(SLogDetail info)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@FlogDetail}", info);
 }
예제 #4
0
 public static void WritePerformance(SLogDetail info)
 {
     _performanceLogger.Write(LogEventLevel.Information, "{@FlogDetail}", info);
 }
예제 #5
0
 public static void WriteError(SLogDetail info)
 {
     _errorLogger.Write(LogEventLevel.Information, "{@FlogDetail}", info);
 }