0

I want to display certain events from the event log on a web page. For this I have to use a MVC4 application in .NET framework version 4. I've read about SignalR and push messages, but I can't find any clear information on how to implement this. Perhaps I am searching for the wrong things.

Can anybody point me to a tutorial on this subject or explain how I can realize a part on a webpage where about the 5 latest relevant events (based on category) are displayed?

user2609980
  • 10,264
  • 15
  • 74
  • 143

1 Answers1

1

Assuming you don't want to update your page in real-time then you can use something like

var eventLog = new EventLog("logName", "machine", "source");
foreach(var entry in eventLog.Entries)
{
}

to read the event log data and then pass it to your view model.

You would only need SignalR if you wanted to push updates to your your page.

user460667
  • 1,870
  • 3
  • 19
  • 26
  • Hey thank you for your answer. We are reading them in real time now with SignalR indeed. Unfortunately this does not work in IE8. I will post a new question about that. – user2609980 Jan 23 '14 at 15:23
  • See http://stackoverflow.com/questions/21312537/pushing-updates-from-event-log-to-webpage-not-working-in-ie8 – user2609980 Jan 23 '14 at 15:29