Question

What is the benefit of using the newer EventLogReader found in namespace System.Diagnostics.Eventing.Reader over the traditional approach of creating and EventLog and reading the entries in the usual fashion?

Was it helpful?

Solution

The problem with the traditional approach is that you have to load all the entries into memory and then filter them on the client - the EventLog.Entries collection loads everything in memory.

With the new approach the events will not be loaded on the client. You could write queries to retrieve only the events you are interested on the client.

So you will be consuming much less memory if you use the new class and your code will probably run faster.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top