I am trying to read through the Windows Event log "Error" entry messages in in c#.
foreach (EventLogEntry log in eventLog.Entries)
{
if (log.EntryType.ToString() == "Error")
{
Console.WriteLine( log.Message);
}
}
The output is "The XYZ service failed to start due to the following error: \r\n%%2"
while the entry I am looking for is
"The XYZ service failed to start due to the following error:\r\nThe system cannot find the file specified."
How does one translate from the id to the appropriate error message ?
Many thanks, KG