Exemplo n.º 1
0
 public static void WriteError(HylogDetails infoToLog)
 {
     if (infoToLog.Exception != null)
     {
         var procName = FindProcName(infoToLog.Exception);
         infoToLog.Location = string.IsNullOrEmpty(procName) ? infoToLog.Location : procName;
         infoToLog.Message  = GetMessageFromException(infoToLog.Exception);
     }
     _errorLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog);
 }
Exemplo n.º 2
0
        public static void WriteDiagonistic(HylogDetails infoToLog)
        {
            var writeDiagnostics = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableDiagnostics"]);

            if (!writeDiagnostics)
            {
                return;
            }

            _diagnosticLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog);
        }
Exemplo n.º 3
0
        public PerfTracker(string name, string userId, string userName, string location, string product, string layer)
        {
            _sw        = Stopwatch.StartNew();
            _infoToLog = new HylogDetails()
            {
                Message  = name,
                UserId   = userId,
                UserName = userName,
                Product  = product,
                Layer    = layer,
                Location = location,
                HostName = Environment.MachineName
            };
            var beginTime = DateTime.Now;

            _infoToLog.AdditionalInfo = new Dictionary <string, object>()
            {
                { "Started", beginTime.ToString(CultureInfo.InvariantCulture) }
            };
        }
Exemplo n.º 4
0
 public static void WriteUsage(HylogDetails infoToLog)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog);
 }
Exemplo n.º 5
0
 public static void WritePerf(HylogDetails infoToLog)
 {
     _perfLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog);
 }