Windows 2000 and Windows XP have an important feature called Event Log a database containing important information about hardware and software events. The event log is useful for recording information about the status of your applications and provides system administrators a means of diagonosing problems, Since they can review event log entries using the event viewer(supplied with Windows and available in administrative tools group in the control panel). There are three types of event log events:
Usualy Contains information, such as an application starting or shutting down.
Usally provides information about unusual conditions that have the potential to become errors.
Represent critical errors in an application that prevent it from executing normally.
Event are stored in Event logs - Windows supports three types of event logs
Application: Contains messages that applications such as Microsoft SQL Server.
System: Contains messages that device drivers and system service log.
Security: Contains system generated message about events that occur whwn security auditing is emabled
The .NET framework makes it easy to work with event log as shown in the following code
IF Not EventLog.SourceExists("AspnetBible") Then
EventLog.CreateEventSource(("AspnetBible" , "Application")
Console.WriteLine("Created New Event Source 'ASPnetBible'")
Dim evLog As New EventLog()
The code is a Visual Basic .NET console application that creates an event souce
called ASPnetBible and write information about application stating and exiting events to the system's application event log
GOD BLESS YOU