-
Notifications
You must be signed in to change notification settings - Fork 1
Home
##Error Logging Filter and Route (ELFAR) for ASP.NET MVC
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)
- ErrorLogProvider, in-memory storage
- SqlErrorLogProvider, SQL Server database
- SqlCeErrorLogProvider, SQL Server Compact Edition database
- SQLiteErrorLogProvider, SQLite database
- AccessErrorLogProvider, Microsoft Office Access database
- XmlErrorLogProvider, XML file storage
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:
- 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
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