Specifies the event type of an event log entry.
Assembly: System (in System.dll)
An error event. This indicates a significant problem the user should know about; usually a loss of functionality or data.
A 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.
An information event. This indicates a significant, successful operation.
A success audit event. This indicates a security event that occurs when an audited access attempt is successful; for example, logging on successfully.
A 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 theclass 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 to specify the event type, gets the message and ID, and then writes the information to the log.
Available since 1.1