Here a sample of code that will write to the application event log, using VB..NET:
Public Function WriteToEventLog(ByVal Entry As String)
Dim appName As String = "Server Maintenance"
Dim eventType As EventLogEntryType = EventLogEntryType.Error
Dim logName = "Application"
Dim objEventLog As New EventLog()
Try
'Register the App as an Event Source
If Not EventLog.SourceExists(appName) Then
EventLog.CreateEventSource(appName, logName)
End If
objEventLog.Source = appName
'WriteEntry is overloaded; this is one
'of 10 ways to call it
objEventLog.WriteEntry(Entry, eventType)
Return True
Catch Ex As Exception
Return False
End Try
End Function