Customize output fields elmah.axd

ELMAH by default displays the host, code, type, error, user, date and time on its error log web page. Is there a way to configure it and show other fields like IP or REFERER?

elmah output example
(source: googlecode.com )

+7
logging elmah
source share
2 answers

ELMAH is open source. You can download the source code and make any changes that you like (in accordance with the terms of the license, of course.)

You can catch any data available to the HttpConext.Request object. You will need to modify the code that captures and stores the data, and the database to create columns for this new data.

+2
source share

You may write your own error page. Bind datagrid to ErrorLog.GetErrors() and use any columns you need:

 List<ErrorLogEntry> entries = new List<ErrorLogEntry>(); ErrorLog.GetDefault(HttpContext.Current).GetErrors(0, 50, entries); string ip = entries[0].Error.ServerVariables["REMOTE_ADDR"]; string referrer = entries[0].Error.ServerVariables["HTTP_REFERER"]; 
+4
source share

All Articles