How to set up Elmah with ASP.NET Web API

前端 未结 4 2066
忘了有多久
忘了有多久 2021-01-31 08:18

I\'ve tried many elmah nugets but they didn\'t work with ASP.NET Web API. Does anybody knows why? Is there any work around for that?

4条回答
  •  礼貌的吻别
    2021-01-31 09:10

    one option would be to setup a custom ExceptionFilterAttribute, override the OnException method, and signal Elmah from there. See the sample link below

    Elmah WebAPI Sample

提交回复
热议问题