Example #1
0
        private void LogError(Exception ex)
        {
            try
            {
                ErrorLog erroLog = new ErrorLog();
                erroLog.ErrorLogMessage    = ex.Message;
                erroLog.ErrorLogCreateDate = DateTime.Now;
                erroLog.ErrorLogStackTrace = ex.StackTrace;

                errorLogService.Add(erroLog);
                errorLogService.SaveChanges();
            }
            catch
            {
            }
        }
Example #2
0
        private void LogError(Exception ex)
        {
            try
            {
                ErrorLog erroLog = new ErrorLog();
                erroLog.ErrorLogMessage    = ex.Message;
                erroLog.ErrorLogCreateDate = DateTime.Now;
                erroLog.ErrorLogStackTrace = ex.StackTrace;

                errorLogService.Create(erroLog);
                errorLogService.SaveChanges();
            }
            catch
            {
                throw new Exception("Có lỗi xảy ra");
            }
        }