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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top