Expand Minimize

EventLogEntryType Enumeration

Specifies the event type of an event log entry.

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

type EventLogEntryType

Member nameDescription
ErrorAn error event. This indicates a significant problem the user should know about; usually a loss of functionality or data.
FailureAuditA failure audit event. This indicates a security event that occurs when an audited access attempt fails; for example, a failed attempt to open a file.
InformationAn information event. This indicates a significant, successful operation.
SuccessAuditA success audit event. This indicates a security event that occurs when an audited access attempt is successful; for example, logging on successfully.
WarningA warning event. This indicates a problem that is not immediately significant, but that may signify conditions that could cause future problems.

The type of an event log entry provides additional information for the entry. Applications set the entry type when they write the entry to the event log.

Each event must be of a single type; the event types cannot be combined for an entry. The Event Viewer uses this type to determine which icon to display in the list view of the log.

The following code example demonstrates how to use the EventLogEntryType class to add information about triggered events to a log file. In this example, a switch statement is used to determine the event type. Each case statement uses the EventLogEntryType to specify the event type, gets the message and ID, and then writes the information to the log.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft