コード例 #1
0
        public void LogException(string message, string callstack)
        {
            ExceptionDataObject exceptionObject = new ExceptionDataObject
            {
                Message       = message,
                CallStack     = callstack,
                ExceptionType = "JavaScript",
                UserAgent     = Request.UserAgent,
                UserId        = (int?)Session[SessionKeys.USER_ID]
            };

            ProcessFactory.GetExceptionProcess().Insert(exceptionObject);
        }
コード例 #2
0
        private void LogException(string message, string type, Exception exception)
        {
            UserPrincipal       user            = GetUserPrincipal();
            ExceptionDataObject exceptionObject = new ExceptionDataObject
            {
                Message       = message,
                CallStack     = exception.StackTrace,
                ExceptionType = type,
                UserAgent     = Request.UserAgent,
                UserId        = user != null ? (int?)user.Id : null
            };

            ProcessFactory.GetExceptionProcess().Insert(exceptionObject);
        }
コード例 #3
0
 public void Insert(ExceptionDataObject exceptionObject)
 {
     using (var context = new IdeaPoolEntities())
     {
         Exception exception = new Exception
         {
             Message       = exceptionObject.Message,
             CallStack     = exceptionObject.CallStack,
             CreatedDate   = DateTime.UtcNow,
             ExceptionType = exceptionObject.ExceptionType,
             UserId        = exceptionObject.UserId,
             UserAgent     = exceptionObject.UserAgent
         };
         context.Exceptions.Add(exception);
         context.SaveChanges();
     }
 }
コード例 #4
0
 private void SendEmail <T>(EmailSettings settings, string templateName, T model)
 {
     try
     {
         emailNotification.SendSystemEmail(settings, templateName, model);
     }
     catch (System.Exception ex)
     {
         ExceptionDataObject exceptionObject = new ExceptionDataObject
         {
             Message       = ex.Message,
             CallStack     = ex.StackTrace,
             ExceptionType = "Email",
             UserId        = LoginUserId
         };
         ProcessFactory.GetExceptionProcess().Insert(exceptionObject);
     }
 }
コード例 #5
0
 public void Insert(ExceptionDataObject exceptionObject)
 {
     exceptionData.Insert(exceptionObject);
 }