EventLevel Sabit listesi

Tanım

Bir olayın düzeyini tanımlar.Identifies the level of an event.

public enum class EventLevel
public enum EventLevel
type EventLevel = 
Public Enum EventLevel
Devralma
EventLevel

Alanlar

Critical 1

Bu düzey önemli bir hataya karşılık gelir ve bu önemli bir hataya neden olan ciddi bir hatadır.This level corresponds to a critical error, which is a serious error that has caused a major failure.

Error 2

Bu düzey bir sorunu işaret eden standart hatalar ekler.This level adds standard errors that signify a problem.

Informational 4

Bu düzey, hata olmayan bilgilendirici olaylar veya mesajlar ekler.This level adds informational events or messages that are not errors. Bu olaylar, bir uygulamanın ilerlemesini veya durumunu izlemeye yardımcı olabilir.These events can help trace the progress or state of an application.

LogAlways 0

Olayda hiçbir düzey filtreleme yapılmaz.No level filtering is done on the event.

Verbose 5

Bu düzey uzun olaylar veya iletiler ekler.This level adds lengthy events or messages. Tüm olayların günlüğe kaydedilmesine neden olur.It causes all events to be logged.

Warning 3

Bu düzey, uyarı olayları ekler (örneğin, bir disk tam kapasiteye yaklaştığı için yayımlanan olaylar).This level adds warning events (for example, events that are published because a disk is nearing full capacity).

Örnekler

Aşağıdaki örnek, Error bir hata iletisini tanımlamak için numaralandırma üyesinin nasıl kullanılacağını gösterir.The following example shows how to use the Error enumeration member to identify an error message. Bu örnek, sınıfı için sağlanmış daha büyük bir örneğin bir parçasıdır EventSource .This example is part of a larger example provided for the EventSource class.

[Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
public void Failure(string message) { WriteEvent(1, message); }
<[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)> _
Public Sub Failure(ByVal message As String)
    WriteEvent(1, message)
End Sub

Aşağıdaki örnek, Informational bilgilendirici bir iletiyi tanımlamak için numaralandırma üyesinin nasıl kullanılacağını gösterir.The following example shows how to use the Informational enumeration member to identify an informational message. Bu örnek, sınıfı için sağlanmış daha büyük bir örneğin bir parçasıdır EventSource .This example is part of a larger example provided for the EventSource class.

[Event(2, Message = "Starting up.", Keywords = Keywords.Perf, Level = EventLevel.Informational)]
public void Startup() { WriteEvent(2); }
<[Event](2, Message:="Starting up.", Keywords:=Keywords.Perf, Level:=EventLevel.Informational)> _
Public Sub Startup()
    WriteEvent(2)
End Sub

Aşağıdaki örnek, Verbose ayrıntılı bir iletiyi tanımlamak için numaralandırma üyesinin nasıl kullanılacağını gösterir.The following example shows how to use the Verbose enumeration member to identify a verbose message. Bu örnek, sınıfı için sağlanmış daha büyük bir örneğin bir parçasıdır EventSource .This example is part of a larger example provided for the EventSource class.

[Event(7, Level = EventLevel.Verbose, Keywords = Keywords.DataBase)]
public void Mark(int ID) { if (IsEnabled()) WriteEvent(7, ID); }
<[Event](7, Level:=EventLevel.Verbose, Keywords:=Keywords.DataBase)> _
Public Sub Mark(ByVal ID As Integer)
    If IsEnabled() Then
        WriteEvent(7, ID)
    End If
End Sub

Açıklamalar

Düzey bir olayın önem derecesini belirtir.The level signifies the severity of an event. Daha düşük önem düzeyleri daha yüksek önem derecelerini kapsayacak.Lower severity levels encompass higher severity levels. Örneğin, Warning Error Critical önem derecesi yüksek olan ve düzeylerini içerir.For example, Warning includes the Error and Critical levels, which are higher in severity.

Şunlara uygulanır