Reading Elmah log in custom code

Skip to first unread message

Phil Harris

May 4, 2017, 1:17:10 PM5/4/17
Hi everyone,

Can anyone tell me how I can read the Elmah log in C#? I want to display the errors in a custom way in MVC but I can't see which part of the API I should be using to e.g. "Get all Elmah errors last 24 hours"

Many thanks

Atif Aziz

May 4, 2017, 1:46:51 PM5/4/17
Hi Phil,

You would simple use ErrorLog.GetErrors to get a page of errors at a time. The errors are always returned in the reverse chronological order so you would just keep paging (in a loop) until you find an error older than 24 hours or whatever criteria you have.

Unless C# is your only cup of tea, you may also want to think about a pure HTML + JavaScript version. Have a look at the elvue project to get started if that sounds interesting.

- Atif

You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Phil Harris

Jul 3, 2017, 11:51:46 AM7/3/17
Thank you sir, I'll give it a try
Reply all
Reply to author
0 new messages