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));
To access ELFAR, navigate to ~/elfar (where ~/ is the root directory of the MVC application).
ELFAR has 6 out-of-the-box error log providers (which can be downloaded from Nuget)
However you can pass in your own ErrorLog
provider by implementing the [IErrorLogProvider] interface.
Once ELFAR has been added to your website/web application, you get the following features:
In addition, there are several optional features available:
Wiki: AccessErrorLogProvider
Wiki: Email notification of errors
Wiki: ErrorLogProvider
Wiki: Excluding unwanted exceptions
Wiki: IErrorLogProvider
Wiki: Posting errors to Twitter
Wiki: Restricting access to the ELFAR web pages
Wiki: SQLiteErrorLogProvider
Wiki: SqlCeErrorLogProvider
Wiki: SqlErrorLogProvider
Wiki: XmlErrorLogProvider