The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventLevel Enumeration

.NET Framework 4.5

Identifies the level of an event.

Namespace:  System.Diagnostics.Tracing
Assembly:  mscorlib (in mscorlib.dll)

public enum EventLevel

Member nameDescription
Supported in .NET for Windows Store appsCriticalThis level corresponds to a critical error, which is a serious error that has caused a major failure.
Supported in .NET for Windows Store appsErrorThis level adds standard errors that signify a problem.
Supported in .NET for Windows Store appsInformationalThis level adds informational events or messages that are not errors. These events can help trace the progress or state of an application.
Supported in .NET for Windows Store appsLogAlwaysNo level filtering is done on the event.
Supported in .NET for Windows Store appsVerboseThis level adds lengthy events or messages. It causes all events to be logged.
Supported in .NET for Windows Store appsWarningThis level adds warning events (for example, events that are published because a disk is nearing full capacity).

The level signifies the severity of an event. Lower severity levels encompass higher severity levels. For example, Warning includes the Error and Critical levels, which are higher in severity.

The following example shows how to use the EventLevel class to specify event levels. This code 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(2, Message = "Starting up.", Keywords = Keywords.Perf, Level = EventLevel.Informational)]
public void Startup() { WriteEvent(2); }
[Event(7, Level = EventLevel.Verbose, Keywords = Keywords.DataBase)]
public void Mark(int ID) { if (IsEnabled()) WriteEvent(7, ID); }

.NET Framework

Supported in: 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft