0 Comments

Introduction

Error Logging Filter and Route (ELFAR) for ASP.NET MVC was inspired by and based on the popular Error Logging Modules And Handlers (ELMAH) for ASP.NET utility. ELFAR retains the familiar ELMAH user interface but has been built to utilise the architecture of ASP.NET MVC. Unlike ELMAH, ELFAR is not driven by configuration and can be added to your website/web application with just 3 lines of code (usually in the Application_Start method):

var provider = new ErrorLogProvider();
GlobalFilters.Filters.Add(new ErrorLogFilter(provider));
RouteTable.Routes.Insert(0, new ErrorLogRoute(provider));
Figure 1

To access ELFAR, navigate to ~/elfar (where ~/ is the root directory of the MVC application).

Available on NuGet

ELFAR has 6 out-of-the-box error log providers:

Features

Once ELFAR has been added to your website/web application, you get the following features:

  • a web page to view a list of error logs
  • a web page to view the details of an error log, including a coloured stack trace
  • a view of the original yellow screen of death (where appropriate)
  • XML and JSON downloads of the error log
  • an RSS feed of the last 15 error logs
  • an RSS digest of daily error logs (limited to 900)
  • a CSV download of all error logs
  •    

Optional features

In addition, there are several optional features available:

  • Excluding unwanted exceptions
  • Restricting access to the ELFAR web pages
  • Email notification of errors   
  • Posting errors to Twitter
  •    

Resources

Further information can be found in the ELFAR Wiki.
Full source for ELFAR can be found at SourceForge.net (Subversion) or GitHub