i am trying to read from the event logs on the server.. my current code is working..
but my worry is when there are thousands of entries in the events, will it take longer to load the page??
here is my working code
ArrayList chromeEntries = new ArrayList();
EventLog eventLog = new EventLog("Application", ".");
foreach (EventLogEntry logEntry in eventLog.Entries)
{
if (logEntry.Source.Equals("Application Error"))
{
chromeEntries.Add(logEntry.TimeWritten);
}
}
GridView1.DataSource = chromeEntries;
GridView1.DataBind();
i want to display the time entries in the application logs which have a source name of "Application Error".. my only concern is for each...?? is my concern valid ? or the above code is just fine..
any suggestions
thanks
ok i tried this
EventLog eventLog = new EventLog("Application", ".", "Application Error");
Label1.Text = eventLog.Entries.Count.ToString();
but it counts the entire entries instead of just counting entries for Application Error