/// <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); }
/// <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); } }
/// <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)); } }
public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo) { foreach (WebBaseEvent eventToFlush in flushInfo.Events) { InsertEvent(eventToFlush); } SaveEvents(); }
// 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); }
public override void ProcessEventFlush(WebEventBufferFlushInfo flushInfo) { this.mongoCollection.InsertBatch <WebEvent>(flushInfo.Events.Cast <WebBaseEvent>().ToList().ConvertAll <WebEvent>(WebEvent.FromWebBaseEvent)); }
//</Snippet15> //<Snippet16> private EventNotificationType GetNotificationType( WebEventBufferFlushInfo flushInfo) { return(flushInfo.NotificationType); }
//</Snippet14> //<Snippet15> private int GetNotificationSequence( WebEventBufferFlushInfo flushInfo) { return(flushInfo.NotificationSequence); }
//</Snippet13> //<Snippet14> private DateTime GetLastNotificationTime( WebEventBufferFlushInfo flushInfo) { return(flushInfo.LastNotificationUtc); }
//</Snippet12> //<Snippet13> private int GetEventsInBuffer( WebEventBufferFlushInfo flushInfo) { return(flushInfo.EventsInBuffer); }
//</Snippet11> //<Snippet12> private int GetEventsDiscardedSinceLastNotification( WebEventBufferFlushInfo flushInfo) { return(flushInfo.EventsDiscardedSinceLastNotification); }
// </Snippet5> //<Snippet11> private WebBaseEventCollection GetEvents( WebEventBufferFlushInfo flushInfo) { return(flushInfo.Events); }
public virtual void ProcessEventFlush(WebEventBufferFlushInfo flushInfo) { }
public abstract virtual void ProcessEventFlush(WebEventBufferFlushInfo flushInfo) {}