Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open saved event log archive in .NET?

Tags:

c#

file

event-log

I have used the System.Diagnostics.EventLog to view the logs on the local computer. However, I would like to open a saved event log archive (.evt or .evtx) and view the logs that are contained in the saved file. I just need to view timestamps, messages, sources, etc. associated with the logs in the file. Can this be done in C#?

like image 860
Brian Avatar asked Jun 08 '10 19:06

Brian


1 Answers

Check out the System.Diagnostics.Eventing.Reader namespace. Specifically the EventLogQuery class.

http://msdn.microsoft.com/en-us/library/bb671200(v=VS.90).aspx

like image 59
Chris Avatar answered Oct 07 '22 00:10

Chris