Пример #1
0
 private static void RaiseSystemEventInternal(string message, object source, int eventCode, int eventDetailCode, Exception exception, string nameToAuthenticate)
 {
     if (HealthMonitoringManager.Enabled)
     {
         SystemEventTypeInfo info;
         SystemEventType     type;
         int num;
         int num2;
         WebEventCodes.GetEventArrayIndexsFromEventCode(eventCode, out num, out num2);
         GetSystemEventTypeInfo(eventCode, num, num2, out info, out type);
         if (info != null)
         {
             ArrayList firingRuleInfos = HealthMonitoringManager.Manager()._sectionHelper.FindFiringRuleInfos(info._type, eventCode);
             if (firingRuleInfos.Count == 0)
             {
                 info._dummyEvent.IncrementPerfCounters();
                 info._dummyEvent.IncrementTotalCounters(num, num2);
             }
             else
             {
                 RaiseInternal(NewEventFromSystemEventType(false, type, message, source, eventCode, eventDetailCode, exception, nameToAuthenticate), firingRuleInfos, num, num2);
             }
         }
     }
 }
Пример #2
0
        private static WebBaseEvent NewEventFromSystemEventType(bool createDummy, SystemEventType systemEventType, string message, object source, int eventCode, int eventDetailCode, Exception exception, string nameToAuthenticate)
        {
            if (!createDummy && (message == null))
            {
                message = WebEventCodes.MessageFromEventCode(eventCode, eventDetailCode);
            }
            switch (systemEventType)
            {
            case SystemEventType.WebApplicationLifetimeEvent:
                if (createDummy)
                {
                    return(new WebApplicationLifetimeEvent());
                }
                return(new WebApplicationLifetimeEvent(message, source, eventCode, eventDetailCode));

            case SystemEventType.WebHeartbeatEvent:
                if (createDummy)
                {
                    return(new WebHeartbeatEvent());
                }
                return(new WebHeartbeatEvent(message, eventCode));

            case SystemEventType.WebRequestEvent:
                if (createDummy)
                {
                    return(new WebRequestEvent());
                }
                return(new WebRequestEvent(message, source, eventCode, eventDetailCode));

            case SystemEventType.WebRequestErrorEvent:
                if (createDummy)
                {
                    return(new WebRequestErrorEvent());
                }
                return(new WebRequestErrorEvent(message, source, eventCode, eventDetailCode, exception));

            case SystemEventType.WebErrorEvent:
                if (createDummy)
                {
                    return(new WebErrorEvent());
                }
                return(new WebErrorEvent(message, source, eventCode, eventDetailCode, exception));

            case SystemEventType.WebAuthenticationSuccessAuditEvent:
                if (createDummy)
                {
                    return(new WebAuthenticationSuccessAuditEvent());
                }
                return(new WebAuthenticationSuccessAuditEvent(message, source, eventCode, eventDetailCode, nameToAuthenticate));

            case SystemEventType.WebSuccessAuditEvent:
                if (createDummy)
                {
                    return(new WebSuccessAuditEvent());
                }
                return(new WebSuccessAuditEvent(message, source, eventCode, eventDetailCode));

            case SystemEventType.WebAuthenticationFailureAuditEvent:
                if (createDummy)
                {
                    return(new WebAuthenticationFailureAuditEvent());
                }
                return(new WebAuthenticationFailureAuditEvent(message, source, eventCode, eventDetailCode, nameToAuthenticate));

            case SystemEventType.WebFailureAuditEvent:
                if (createDummy)
                {
                    return(new WebFailureAuditEvent());
                }
                return(new WebFailureAuditEvent(message, source, eventCode, eventDetailCode));

            case SystemEventType.WebViewStateFailureAuditEvent:
                if (createDummy)
                {
                    return(new WebViewStateFailureAuditEvent());
                }
                return(new WebViewStateFailureAuditEvent(message, source, eventCode, eventDetailCode, (ViewStateException)exception));
            }
            return(null);
        }