예제 #1
0
        public static void LogException(BaseException ex, string className, string methodName)
        {
            if (ex.InsertedLog)
            {
                return;
            }
            ex.InsertedLog = true;
            string curentUsername = Security.BUser.CurrentUser.UserName;

            if (curentUsername.ToLower().Equals("nunituser"))
            {
                return;
            }

            if (IsBusinessErrorLogEnable)
            {
                if (ex is InvalidPersianDateException)
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "GTS.Clock.Business", " InvalidPersianDateException --> " + ((InvalidPersianDateException)ex).GetLogMessage(), ex);
                }
                else if (ex is UIBaseException)
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "GTS.Clock.Business", String.Format("{0} --> {1}", ex.GetType().Name, ((UIBaseException)ex).GetLogMessage()), ex);
                }
                else
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "GTS.Clock.Business", String.Format("{0} --> {1}", ex.GetType().Name, ((BaseException)ex).GetLogMessage()), ex);
                }
            }
        }
예제 #2
0
        protected void LogException(BaseException ex, string className, string methodName, string currentUserName, bool isBusinessLogEnable)
        {
            if (ex.InsertedLog)
            {
                return;
            }
            ex.InsertedLog = true;
            string curentUsername = currentUserName;

            if (curentUsername.ToLower().Equals("nunituser"))
            {
                return;
            }

            if (isBusinessLogEnable)
            {
                if (ex is InvalidPersianDateException)
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "BaseGTSBusiness", " InvalidPersianDateException --> " + ((InvalidPersianDateException)ex).GetLogMessage(), ex);
                }
                else if (ex is UIBaseException)
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "BaseGTSBusiness", String.Format("{0} --> {1}", ex.GetType().Name, ((UIBaseException)ex).GetLogMessage()), ex);
                }
                else
                {
                    businessErrorlogger.Error(curentUsername, className, methodName, "BaseGTSBusiness", String.Format("{0} --> {1}", ex.GetType().Name, ((BaseException)ex).GetLogMessage()), ex);
                }
            }
        }
예제 #3
0
 protected void Button4_Click(object sender, EventArgs e)
 {
     Infrastructure.Log.BusinessServiceLogger log = new BusinessServiceLogger();
     log.Error("21321", "test");
     log.Flush();
 }
예제 #4
0
 private void LogException(Exception ex, string methodName, string info)
 {
     logger.Error(info, "GTSMembershipProvider", methodName, "GTS.Clock.Repository", Utility.GetExecptionMessage(ex), ex);
 }
예제 #5
0
 protected void Btn1_Click(object sender, EventArgs e)
 {
     busLogger.Error("323232", "sdfasdfasdasdasdas", new Exception("asdasdasdas"));
     busLogger.Flush();
 }