My question is very similar to this one How do you open the event log programatically? Except i\'m logging anything. I need to create db of Log Entries from multiple unconnecte
Use System.Diagnostics.Eventing.Reader.EventLogReader:
using (var reader = new EventLogReader(@"path\to\log.evtx", PathType.FilePath))
{
EventRecord record;
while((record = reader.ReadEvent()) != null)
{
using (record)
{
Console.WriteLine("{0} {1}: {2}", record.TimeCreated, record.LevelDisplayName, record.FormatDescription());
}
}
}