I am trying to have a service write out to a custom log in the event log.
I'm using the following code:
Dim lsEventSource As String = "test1234"
Dim lsEventLog As String = "CustomLog"
If (Not EventLog.SourceExists(lsEventSource)) Then
EventLog.DeleteEventSource(lsEventSource)
EventLog.CreateEventSource(lsEventSource, lsEventLog)
End If
Dim llogEventLog As EventLog
llogEventLog = New EventLog
llogEventLog.Source = lsEventSource
llogEventLog.WriteEntry("This is a test spot for the event log.")
Can anybody tell me what's wrong with the code? No matter what I put for the
lsEventLog name, it always is being written to the Application log. I've
also tried changing the name of the EventSource to something else just to
see what happens then.....