EventLog
Provides interaction with Windows event logs.
Gets or sets a value indicating whether the EventLog receives EntryWritten event notifications.
Gets the contents of the event log.
Gets or sets the name of the log to read from or write to.
Gets the event log's friendly name.
Gets or sets the name of the computer on which to read or write events.
Gets or sets the maximum event log size in kilobytes.
Gets the number of days to retain entries in the event log.
Gets the configured behavior for storing new entries when the event log reaches its maximum log file size.
Gets or sets the source name to register and use when writing to the event log.
Gets or sets the object used to marshal the event handler calls issued as a result of an EventLog entry written event.
Occurs when an entry is written to an event log on the local computer.
public EventLog()
Initializes a new instance of the EventLog class. Does not associate the instance with any log.
Initializes a new instance of the EventLog class. Associates the instance with a log on the local computer.
Initializes a new instance of the EventLog class. Associates the instance with a log on the specified computer.
Initializes a new instance of the EventLog class. Associates the instance with a log on the specified computer and creates or assigns the specified source to the EventLog.
Establishes a valid event source for writing localized event messages, using the specified configuration properties for the event source and the corresponding event log.
Establishes the specified source name as a valid event source for writing entries to a log on the local computer. This method can also create a new custom log on the local computer.
Establishes the specified source name as a valid event source for writing entries to a log on the specified computer. This method can also be used to create a new custom log on the specified computer.
Removes an event log from the local computer.
Removes an event log from the specified computer.
Removes the event source registration from the event log of the local computer.
Removes the application's event source registration from the specified computer.
Determines whether the log exists on the local computer.
Determines whether the log exists on the specified computer.
Searches for all event logs on the local computer and creates an array of EventLog objects that contain the list.
Searches for all event logs on the given computer and creates an array of EventLog objects that contain the list.
Gets the name of the log to which the specified source is registered.
Determines whether an event source is registered on the local computer.
Determines whether an event source is registered on a specified computer.
Writes an information type entry with the given message text to the event log, using the specified registered event source.
Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log, using the specified registered event source.
Writes an entry with the given message text and application-defined event identifier to the event log, using the specified registered event source.
public static void WriteEntry(string source, string message, EventLogEntryType type, int eventID, short category)
Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, using the specified registered event source. The category can be used by the Event Viewer to filter events in the log.
public static void WriteEntry(string source, string message, EventLogEntryType type, int eventID, short category, byte[] rawData)
Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log (using the specified registered event source) and appends binary data to the message.
Writes an event log entry with the given event data, message replacement strings, and associated binary data, and using the specified registered event source.
Writes an event log entry with the given event data and message replacement strings, using the specified registered event source.
Begins the initialization of an EventLog used on a form or used by another component. The initialization occurs at runtime.
Removes all entries from the event log.
Closes the event log and releases read and write handles.
Ends the initialization of an EventLog used on a form or by another component. The initialization occurs at runtime.
Changes the configured behavior for writing new entries when the event log reaches its maximum file size.
Specifies the localized name of the event log, which is displayed in the server Event Viewer.
Writes an information type entry, with the given message text, to the event log.
Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log.
Writes an entry with the given message text and application-defined event identifier to the event log.
Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log.
public void WriteEntry(string message, EventLogEntryType type, int eventID, short category, byte[] rawData)
Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, and appends binary data to the message.
Writes an event log entry with the given event data, message replacement strings, and associated binary data.
Writes a localized entry to the event log.