Skip to content

AlenaMonson/elmah-contrib-webapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elmah.Contrib.WebApi

Elmah.Contrib.WebApi provides an ASP.NET Web API exception filter, ElmahHandleErrorApiAttribute, for logging errors directly to ELMAH.

The latest package is also available as a zip from the downloads page.

Usage

Simply register it during your application's start up, or on a controller-by-controller basis.

protected void Application_Start()
{
    GlobalConfiguration.Configuration.Filters.Add(new ElmahHandleErrorApiAttribute());

    ...
}

Note this filter requires ASP.NET (it passes the HttpContext directly to ELMAH to record info about the HTTP request). It will not work in a self-hosted WCF application.

Acknowledgements

This library is a port of Fabian Vilers' Elmah.Contrib.Mvc to ASP.NET Web API. The original implementation (for MVC) can be found here.

License

As a derivative work of Elmah.Contrib.Mvc, this library is available under the same MS-PL license.

Release History / Changelog

1.0.6.0 - June 2, 2013

Removed Elmah from NuGet dependency list -- we only need Elmah.CoreLibrary. (Thanks @DavidDeSloovere).

1.0.5.0 - March 25, 2013

Patch from shchahrykovich to not throw a NullReferenceException in the event that HttpContext.Current.ApplicationInstance is null (pull request #3).

1.0.4.0 - October 2, 2012

Added missing .nuspec package dependencies.

1.0.2.0 - September 30, 2012

Fix for issue #2, updated to use new Microsoft.AspNet.WebApi.Core NuGet package.

1.0.1.0 - July 8, 2012

Minor fix issue #1, removed Elmah and System.Web.Http assemblies from NuGet package.

1.0.0.0 - May 20, 2012

Initial release.

About

Elmah.Contrib.WebApi provides an ASP.NET Web API exception filter, ElmahHandleErrorApiAttribute, for logging errors directly to ELMAH.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors