You create EventLog components when you want to build event log monitoring functionality into your application. EventLog components allow you to connect to existing event logs, write entries to them, and react to entries the logs receive.
To create EventLog components programmatically
[Visual Basic] Dim myEL As New System.Diagnostics.EventLog [C#] System.Diagnostics.EventLog myEL = new EventLog();
Note You must set the Monitoring property on your component instance to true before your component will work.
Introduction to the EventLog Component | Configuring EventLog Components