O
One Handed Man [ OHM# ]
I'm stuck on something stupid. I thought this code would generate events in the windows event log under the Superanuation Log heading. However, it does not. I found if I use the EventLog.writeEntry method to get a register of the message on the log. I'm a bit onfused with this because the EventLog class has a message container, where all the items are stored from by the listener, I would have thought that this would auto write to the log.
I know I'm tired and simply missing the right way to do this, someone help me clear the mist please !
Regards - A very Nackered - OHM
Dim myLog As New EventLog("Superannuation Log")
myLog.Source = "Trace Output"
Try
Dim myListener As New EventLogTraceListener(myLog)
Trace.AutoFlush = True
Dim x As Integer
For x = 10000 To 500000 Step 5000
Trace.WriteLine(x.ToString)
Trace.Flush()
Next
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try
I know I'm tired and simply missing the right way to do this, someone help me clear the mist please !
Regards - A very Nackered - OHM
Dim myLog As New EventLog("Superannuation Log")
myLog.Source = "Trace Output"
Try
Dim myListener As New EventLogTraceListener(myLog)
Trace.AutoFlush = True
Dim x As Integer
For x = 10000 To 500000 Step 5000
Trace.WriteLine(x.ToString)
Trace.Flush()
Next
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try