WebEventBufferFlushInfo Classe

Definizione

Contiene i parametri che definiscono le caratteristiche del buffer di scaricamento.

public ref class WebEventBufferFlushInfo sealed
public sealed class WebEventBufferFlushInfo
type WebEventBufferFlushInfo = class
Public NotInheritable Class WebEventBufferFlushInfo
Ereditarietà
WebEventBufferFlushInfo

Esempio

Nell'esempio di codice seguente viene illustrato come usare la WebEventBufferFlushInfo classe . Questo esempio di codice fa parte di un esempio più ampio fornito per la BufferedWebEventProvider classe .


// Processes the messages that have been buffered.
// It is called by the ASP.NET when the flushing of 
// the buffer is required.
public override void ProcessEventFlush(
    WebEventBufferFlushInfo flushInfo)
{

    // Customize event information to be sent to 
    // the Windows Event Viewer Application Log.
    customInfo.AppendLine(
        "SampleEventLogWebEventProvider buffer flush.");

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

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

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

    // Read each buffered event and send it to the
    // Application Log.
    foreach (WebBaseEvent eventRaised in flushInfo.Events)
        customInfo.AppendLine(eventRaised.ToString());

    // Store the information in the specified file.
    StoreToFile(customInfo, logFilePath, FileMode.Append);
}
    ' 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 Overrides Sub ProcessEventFlush(ByVal flushInfo _
    As WebEventBufferFlushInfo)

        ' Customize event information to be sent to 
        ' the Windows Event Viewer Application Log.
        customInfo.AppendLine( _
        "SampleEventLogWebEventProvider buffer flush.")

        customInfo.AppendLine(String.Format( _
        "NotificationType: {0}", _
        GetNotificationType(flushInfo)))

        customInfo.AppendLine(String.Format( _
        "EventsInBuffer: {0}", _
        GetEventsInBuffer(flushInfo)))

        customInfo.AppendLine(String.Format( _
        "EventsDiscardedSinceLastNotification: {0}", _
GetEventsDiscardedSinceLastNotification( _
flushInfo)))

        ' Read each buffered event and send it to the
        ' Application Log.
        Dim eventRaised As WebBaseEvent
        For Each eventRaised In flushInfo.Events
            customInfo.AppendLine(eventRaised.ToString())
        Next eventRaised
        ' Store the information in the specified file.
        StoreToFile(customInfo, logFilePath, _
        FileMode.Append)
    End Sub

Commenti

ASP.NET il monitoraggio dell'integrità consente al personale operativo e di produzione di gestire le applicazioni Web distribuite. Lo System.Web.Management spazio dei nomi contiene i tipi di evento di integrità responsabili della creazione di pacchetti di dati sullo stato di integrità dell'applicazione e i tipi di provider responsabili dell'elaborazione di questi dati. Contiene anche tipi di supporto utili durante la gestione degli eventi di integrità.

La WebEventBufferFlushInfo classe definisce i valori che identificano lo stato corrente del buffer. Un'istanza della classe viene passata come parametro al ProcessEventFlush metodo che elabora i messaggi memorizzati nel buffer. ASP.NET il monitoraggio dell'integrità chiama questo metodo quando è necessario lo scaricamento del buffer. Ciò è determinato dai parametri definiti dall'elemento bufferModes nella healthMonitoring sezione di configurazione.

Note

Per impostazione predefinita, il meccanismo di buffering potrebbe eliminare alcuni eventi per mantenere il ritmo con gli eventi in ingresso. Spetta all'utente modificare questo meccanismo modificando correttamente l'elemento bufferModes nella healthMonitoring sezione di configurazione.

Proprietà

Nome Descrizione
Events

Ottiene la raccolta di eventi nel messaggio corrente.

EventsDiscardedSinceLastNotification

Ottiene il numero di eventi eliminati dall'ultima notifica.

EventsInBuffer

Ottiene il numero di eventi nel buffer.

LastNotificationUtc

Ottiene la data e l'ora dell'ultima notifica.

NotificationSequence

Ottiene la sequenza di messaggi nella notifica corrente.

NotificationType

Ottiene il tipo di notifica corrente.

Metodi

Nome Descrizione
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche