Example #1
0
 public static void DisposeApp()
 {
     AppLogger.CloseLogfiles();
     AppLogger = null;
     Logger.CloseLogfiles();
     Logger = null;
     FormatWriter.dispose();
 }
Example #2
0
 static AppGlobal()
 {
     AppLogger    = new AppLog();
     Logger       = new AppErrorLog();
     FormatWriter = new LogFormatter(ref Logger);
     AppLogger.GenerateLogfiles(Application.StartupPath + "\\" + Application.ProductName + "\\ApplicationLog", "Trace_" + Application.ProductName);
     Logger.GenerateLogfiles(Application.StartupPath + "\\" + Application.ProductName + "\\ApplicationLog", Application.ProductName);
 }
Example #3
0
 public static void DisposeApp()
 {
     AppLogger.CloseLogfiles();
     AppLogger = null;
     Logger.CloseLogfiles();
     Logger = null;
     FormatWriter.dispose();
 }
Example #4
0
 static AppGlobal()
 {
     AppLogger = new AppLog();
     Logger = new AppErrorLog();
     FormatWriter = new LogFormatter(ref Logger);
     AppLogger.GenerateLogfiles(Application.StartupPath + "\\" + Application.ProductName + "\\ApplicationLog", "Trace_" + Application.ProductName);
     Logger.GenerateLogfiles(Application.StartupPath + "\\" + Application.ProductName + "\\ApplicationLog", Application.ProductName);
 }
Example #5
0
        public void CaptureErrorValues(string error)
        {
            var uow         = new UnitOfWork();
            var AppErrorLog = new AppErrorLog();

            AppErrorLog.ErrorMsg = error;
            AppErrorLog.datelog  = BaseUtil.GetCurrentDateTime();
            uow.AppErrorLog_.Add(AppErrorLog);
        }
Example #6
0
        public void Add(AppErrorLog log)
        {
            try
            {
                DbInstance.AppErrorLogs.Add(log);

                DbInstance.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #7
0
        protected override void OnException(ExceptionContext exceptionContext)
        {
            sbv_uuwebstoreEntities db = new sbv_uuwebstoreEntities();

            if (!exceptionContext.ExceptionHandled)
            {
                var uow         = new UnitOfWork();
                var AppErrorLog = new AppErrorLog();
                AppErrorLog.ErrorMsg = exceptionContext.Exception.Message;
                AppErrorLog.datelog  = BaseUtil.GetCurrentDateTime();
                if (exceptionContext.Exception.InnerException != null)
                {
                    AppErrorLog.innerException = exceptionContext.Exception.InnerException.Message;
                    AppErrorLog.stackTrace     = exceptionContext.Exception.StackTrace;
                }
                uow.AppErrorLog_.Add(AppErrorLog);
                TempData["error"]                 = exceptionContext.Exception.Message;
                TempData["innererror"]            = exceptionContext.Exception.InnerException;
                exceptionContext.ExceptionHandled = true;
                exceptionContext.Result           = new RedirectResult("~/Views/Shared/Error.cshtml");
                return;
            }
        }