EventLogReader and EventRecord: where is the message?

I want to query the application event log on the remote machine, and I resorted to using EventLogReader and not EventLog because it takes a long time to find the events I need with EventLog . However, even though it finds events much faster using EventLogReader , I can't figure out where the hell the information I need is on this object ... especially on the message.

  public static void Load() { string query = "*[System/Provider/@Name=\"SQLSERVERAGENT\"]"; EventLogQuery elq = new EventLogQuery("Application", PathType.LogName, query); elq.Session = new EventLogSession("xxxx"); EventLogReader elr = new EventLogReader(elq); _logEntries = new List<SqlEventEntry>(); EventRecord entry; while ((entry = elr.ReadEvent()) != null) { var Message = entry.??? // I want process the message in the event here, // but I can't find a property anywhere that contains the message?? } } 
+10
c # event-log
source share
1 answer

Sigh ... This is the FormatDescription() method. I did not see this because I was only looking at the properties.

+16
source share

All Articles