Managing my own EventLog
-
Hi, I've created a VB.NET application. I want that all exception generate an eventlog entry. I want also a specific eventlog so that it would be faster to find errors in logs. I've written the code below. When running, all is ok (no error) but when I launch the eventlog console to have a look, I can see my eventlog but there is not entry in it.
' Create the source, if it does not already exist. If Not EventLog.SourceExists("OrthoDLL") Then Console.WriteLine(EventLog.LogNameFromSourceName("OrthoDLL", ".")) EventLog.CreateEventSource("OrthoDLL", "Sybux") Console.WriteLine("CreatingEventSource") Console.WriteLine(EventLog.LogNameFromSourceName("OrthoDLL", ".")) End If Dim myLog As New EventLog() myLog.Source = "OrthoDLL" ' Write an informational entry to the event log. myLog.WriteEntry("Writing to event log.")
thx for help