I have a service written in VB .NET 2003, running on Server 2003 under the
localsystem account, that attempts to write to a custom event log. Whilst it
creates the custom log ok, all events get written to the Application log.
Can anyone spot my mistake?
Const EVENT_LOG_SOURCE As String = "MyService"
Const EVENT_LOG_NAME As String = "MyLog"
Private Sub WriteEventLog(ByVal logMsg As String, ByVal type As
System.Diagnostics.EventLogEntryType)
If Not EventLog.SourceExists(EVENT_LOG_SOURCE, ".") Then
EventLog.CreateEventSource(EVENT_LOG_SOURCE, EVENT_LOG_NAME)
End If
Dim MyLog As New EventLog(EVENT_LOG_NAME, ".", EVENT_LOG_SOURCE)
MyLog.WriteEntry(logMsg, type)
End Sub