/// <summary>
        /// Processes the buffered events.
        /// </summary>
        /// <param name="flushInfo">A <see cref="T:System.Web.Management.WebEventBufferFlushInfo"/> that contains buffering information.</param>
        public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
        {
            if (flushInfo == null)
            {
                throw new ArgumentNullException("flushInfo");
            }

            foreach (WebBaseEvent eventRaised in flushInfo.Events)
            {
                string            extraInfo          = string.Empty;
                WebBaseErrorEvent webBasedErrorEvent = eventRaised as WebBaseErrorEvent;

                if (webBasedErrorEvent != null)
                {
                    extraInfo = webBasedErrorEvent.ErrorException.ToString();
                }

                this.customInfo.AppendLine(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        "Event Time (UTC):[{0}] Event Code:[{1}] Event Id:[{2}] Event Message:[{3}]",
                        eventRaised.EventTimeUtc,
                        eventRaised.EventCode,
                        eventRaised.EventID,
                        eventRaised.Message + " " + extraInfo));
            }

            this.StoreToFile(FileMode.Append);
        }
Example #2
0
 /// <summary>
 /// Processes the messages that have been buffered.
 /// It is called by the ASP.NET when the flushing of 
 /// the buffer is required according to the parameters 
 /// defined in the 'bufferModes' element of the 
 /// 'healthMonitoring' configuration section.
 /// </summary>
 /// <param name="flushInfo">The buffered Events Information</param>
 public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
 {
     if (null != flushInfo)
     {
         foreach (WebBaseEvent raisedEvent in flushInfo.Events)
             StoreToDB(raisedEvent);
     }
 }
Example #3
0
 /// <summary>
 /// Processes the buffered events.
 /// </summary>
 /// <param name="flushInfo">A System.Web.Management.WebEventBufferFlushInfo that contains buffering information.</param>
 public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
 {
     // Log the events buffered in flushInfo.Events
     foreach (WebBaseEvent raisedEvent in flushInfo.Events)
     {
         LogEntry(FormatEntry(raisedEvent));
     }
 }
Example #4
0
        public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
        {
            foreach (WebBaseEvent eventToFlush in flushInfo.Events)
            {
                InsertEvent(eventToFlush);
            }

            SaveEvents();
        }
Example #5
0
        // Processes the messages that have been buffered.
        // It is called by the ASP.NET when the flushing of
        // the buffer is required according to the parameters
        // defined in the <bufferModes> element of the
        // <healthMonitoring> configuration section.
        public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
        {
            // Customize event information to be logged.
            customInfo.AppendLine();
            customInfo.AppendLine("SampleEventLogWebEventProvider buffer flush.");

            customInfo.AppendLine(string.Format("NotificationType: {0}", flushInfo.NotificationType));

            customInfo.AppendLine(string.Format("EventsInBuffer: {0}", flushInfo.EventsInBuffer));

            customInfo.AppendLine(string.Format("EventsDiscardedSinceLastNotification: {0}", flushInfo.EventsDiscardedSinceLastNotification));


            // Read each buffered event and send it to the
            // Log.
            foreach (WebBaseEvent eventRaised in flushInfo.Events)
            {
                customInfo.AppendLine(eventRaised.ToString(true, true));
                customInfo.AppendLine("----------------------------------------------------------");
            }
            // Store the information in the specified file.
            customInfo.AppendLine();
            StoreToFile(customInfo, logFilePath, FileMode.Append);
        }
Example #6
0
 public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
 {
     this.mongoCollection.InsertBatch <WebEvent>(flushInfo.Events.Cast <WebBaseEvent>().ToList().ConvertAll <WebEvent>(WebEvent.FromWebBaseEvent));
 }
Example #7
0
        //</Snippet15>

        //<Snippet16>
        private EventNotificationType GetNotificationType(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.NotificationType);
        }
Example #8
0
        //</Snippet14>

        //<Snippet15>
        private int GetNotificationSequence(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.NotificationSequence);
        }
Example #9
0
        //</Snippet13>

        //<Snippet14>
        private DateTime GetLastNotificationTime(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.LastNotificationUtc);
        }
Example #10
0
        //</Snippet12>

        //<Snippet13>
        private int GetEventsInBuffer(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.EventsInBuffer);
        }
Example #11
0
        //</Snippet11>

        //<Snippet12>
        private int GetEventsDiscardedSinceLastNotification(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.EventsDiscardedSinceLastNotification);
        }
Example #12
0
        // </Snippet5>

        //<Snippet11>
        private WebBaseEventCollection GetEvents(
            WebEventBufferFlushInfo flushInfo)
        {
            return(flushInfo.Events);
        }
 public virtual void ProcessEventFlush(WebEventBufferFlushInfo flushInfo)
 {
 }
	public abstract virtual void ProcessEventFlush(WebEventBufferFlushInfo flushInfo) {}