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.Source Exists(lsEventS ource)) Then
EventLog.Delete EventSource(lsE ventSource)
EventLog.Create EventSource(lsE ventSource, lsEventLog)
End If
Dim llogEventLog As EventLog
llogEventLog = New EventLog
llogEventLog.So urce = lsEventSource
llogEventLog.Wr iteEntry("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.....