Using the EventLog Class in VB.net
By: Steven Holzner
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 3, the more notable public properties of EventLog objects in Table 4, their more notable methods in Table 5, and their more notable events in Table 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. |
Archived Comments
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net
Exception Filtering in the Catch Block in VB.net
Using Multiple Catch Statements in VB.net
Throwing an Exception in VB.net
Throwing a Custom Exception in VB.net
Changes in Controls from VB6 to VB.net
Unstructured Exception Handling in VB.net