문제

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