Exemple #1
0
        static void Main(string[] args)
        {
            var fd = GetLogDetails("starting application", null);

            Hlogger.WriteDiagonistic(fd);

            var tracker = new PerfTracker("CrxConsole_Execution", "", fd.UserName, fd.Location, fd.Product, fd.Layer);

            try
            {
                var ex = new Exception("Something bad has happend!");
                ex.Data.Add("input param", "nothing to see here");
                throw ex;
            }
            catch (Exception ex)
            {
                fd = GetLogDetails("", ex);
                Hlogger.WriteError(fd);
            }
            fd = GetLogDetails("Used Hylogger Console", null);
            Hlogger.WriteUsage(fd);

            fd = GetLogDetails("stopping app", null);
            Hlogger.WriteDiagonistic(fd);

            tracker.Stop();
        }
Exemple #2
0
        public static void LogWebError(string product, string layer, Exception ex)
        {
            string userId, userName, location;
            var    webInfo = GetWebFloggingData(out userId, out userName, out location);

            var errorInformation = new HylogDetails()
            {
                Product        = product,
                Layer          = layer,
                Location       = location,
                TimeStamp      = DateTime.Now,
                UserId         = userId,
                UserName       = userName,
                HostName       = Environment.MachineName,
                CorrelationId  = HttpContext.Current.Session?.SessionID,
                Exception      = ex,
                AdditionalInfo = webInfo
            };

            Hlogger.WriteError(errorInformation);
        }