Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

.NET 4 with EventLog dumps entire log

$
0
0

My app has the following code to capture security event logs

Dim SecobjLog As EventLog = New EventLog("Security")
AddHandler SecobjLog.EntryWritten, AddressOf SecurityLog_OnEntryWritten
SecobjLog.EnableRaisingEvents = True

Sub SecurityLog_OnEntryWritten(ByVal [source] As Object, ByVal e As EntryWrittenEventArgs)
'--- Process Logs
End Sub

This code has been working for years.   When a new security event is generated on the server, the .EntryWritten function fires and my program processes it.  However, I recently upgraded my app to use .NET 4.0 and something went wrong.  Now, at seemingly random intervals, the ENTIRE security log is captured.  At over 100,000 logs, you can see where my program would have some issues.   Why is the .EntryWritten function in VB dumping the entire security log?   It should only be dumping the latest logs as they happen.

I have tried this with .NET 4.0 and .NET 4.5 and both seem to have this issue.  If I go back to using .NET 3.5, everything works fine again.  What changed?

Does anyone have any idea why this is happening?





"MC"


Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>