Пример #1
0
        public void AddNewEvent(
            string functionName,
            long v_executionTime,
            _EventDetail eventDetail,
            RequestInfo info = null
            )
        {
            MyEvent evnt = new MyEvent();

            evnt.ControllerName     = eventDetail.ControllerName;
            evnt.MethodName         = eventDetail.MethodName;
            evnt.EventSource        = eventDetail.EventSource;
            evnt.ExecutionTime      = v_executionTime;
            evnt.EventDate          = DateTime.Now;
            evnt.FunctionName       = functionName;
            evnt.OperationIdUserRef = info.IdUserRef;
            evnt.OperationDate      = DateTime.Now;
            evnt.OperationIsDeleted = _Enumeration._TypeOperationIsDeleted.UnDeleted;
            evnt.OperationIP        = info.OperationIP;
            evnt.MachineName        = info.MachineName;
            evnt.MachineIp          = info.MachineIP;
            evnt.ClientBrowser      = info.ClientBrowser;

            Derin_Logging.WriteToEventQueue(Derin_Logging.Type.Event, SerializeObject(evnt));
        }
Пример #2
0
        public static _EventDetail GenerateEventSource(
            _EventDetail eventDetail,
            string query,
            string paramList)
        {
            if (paramList == null)
            {
                eventDetail.EventSource = query;
                return(eventDetail);
            }

            eventDetail.EventSource = query;

            return(eventDetail);
        }
Пример #3
0
        public void Stop <T>(
            string v_functionName,
            _EventDetail v_eventDetail,
            T item, RequestInfo info = null)
        {
            if (ConstantVarible._Project_Settings_EventLoggingEnabled)
            {
                v_eventDetail.EventSource = SerializeTObject(item);
                serviceTimer.Stop();
                var serviceTimer_Duration = serviceTimer.ElapsedMilliseconds;

                AddNewEvent(
                    v_functionName,
                    serviceTimer_Duration,
                    v_eventDetail, info
                    );
            }
        }
Пример #4
0
        protected static void Save(int errorCode, string errorMessage, string functionCode, _EventDetail eventDetail)
        {
            MyException ex = new MyException();

            ex.FunctionName       = functionCode;
            ex.ErrorCode          = errorCode;
            ex.ExceptionSource    = errorMessage;
            ex.ControllerName     = FilterParameter.ToSafeString(eventDetail.ControllerName);
            ex.MethodName         = FilterParameter.ToSafeString(eventDetail.MethodName);
            ex.OperationIdUserRef = SessionVariable._IdUserRef;
            ex.OperationIP        = SessionVariable._OperationIP;
            ex.OperationIsDeleted = 1;
            ex.MachineName        = SessionVariable._MachineName;
            ex.MachineIp          = SessionVariable._MachineIp;
            ex.ClientBrowser      = SessionVariable._ClientBrowser;

            Derin_Logging.WriteToQueue(Derin_Logging.Type.Exception, SerializeObject(ex));
        }
Пример #5
0
        public Derin_Exception(string message, int errorCode, Exception innerException, string errorDetail, _EventDetail _evntDetail)
            : base(message, innerException)
        {
            _errorCode = errorCode;
            if (innerException.InnerException != null)
            {
                _errorMessage = innerException.InnerException.Message;
            }
            else
            {
                _errorMessage = innerException.Message;
            }
            _functionCode = message + " -> " + innerException.Message;;

            if (innerException.InnerException != null)
            {
                if (innerException.InnerException is System.Data.SqlClient.SqlException)
                {
                    int i = ((System.Data.SqlClient.SqlException)(innerException.InnerException)).Number;
                }
            }

            if (errorCode != (int)_Enumeration._TypeException.Validation)
            {
                Save(_errorCode, _errorMessage + "->" + errorDetail, _functionCode, _evntDetail);
            }
        }