Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elmah log error page customization

Tags:

c#

logging

elmah

I would like to use Elmah for logging of the operations in application and not just for errors (I know it, literally means error logging module).

So, I would like to customize the default error view screen (../elmah.axd):

I have wishes like below:

  1. Change the Column Name "Error" for "Message"
  2. Use html tags in the error message.

For logging a custom information, I'm using a method like:

ErrorSignal.FromCurrentContext().Raise(new Elmah.ApplicationException(message));

But it does show the message in a span tag and if I use any <a href=""> or <br /> or even &lt; the result is as written and not seen as html attribute.


The default page is below for visual understanding:

enter image description here

like image 514
Beytan Kurt Avatar asked Jun 01 '12 12:06

Beytan Kurt


1 Answers

Elmah is a single dll, so you have to download the source code, change rendering in ErroLogPage, ErrorDetailPage, rebuild, and deploy the modified assembly.

Or write a new custom display page that uses elmah errors directly stored in db/disk/etc.

like image 112
Akos Lukacs Avatar answered Oct 01 '22 04:10

Akos Lukacs