![]() ![]() | ||
The EventLog class supports access to Windows event logs from Windows services. Here is the inheritance hierarchy of this class:
Object MarshalByRefObject Component EventLog
You can find the more notable public class methods of EventLog in Table 25.3, the more notable public properties of EventLog objects in Table 25.4, their more notable methods in Table 25.5, and their more notable events in Table 25.6.
Method |
Means |
---|---|
CreateEventSource |
Enables an application to write event data to a log. |
Delete |
Removes a log. |
DeleteEventSource |
Removes an application's event source registration. |
Exists |
Indicates if a log exists. |
GetEventLogs |
Returns an array of event logs. |
LogNameFromSourceName |
Gets the name of the log a source is registered with. |
SourceExists |
Checks for a specific event source. |
WriteEntry |
Writes an entry in the log. |
Property |
Means |
---|---|
EnableRaisingEvents |
Gets/sets if the event log gets EntryWritten events. |
Entries |
Gets the contents of the log. |
Log |
Gets/sets the name of the log. |
LogDisplayName |
Gets the log's display name. |
MachineName |
Gets/sets the name of the log's computer. |
Source |
Gets/sets the source name to use when writing to the log. |
Method |
Means |
---|---|
BeginInit |
Begins the initialization operation of an event log. |
Clear |
Clears all entries from the log. |
Close |
Closes the log. |
EndInit |
Ends the initialization operation of an event log. |
WriteEntry |
Writes an entry in the event log. |
Event |
Means |
---|---|
EntryWritten |
Occurs when data is written to an event log. |
![]() ![]() | ||