Elmah - error handling

Add nuget packages, elmah and elmah.mvc

Now you have to make it secure. Otherwise google will index your logs, and hackers will forever find your secrets.

One technique is:

    <security allowRemoteAccess="0" />

But if you need to see the logs remotely, you have to set that to "1" — and then limit the access via standard location settings.

e.g. Here I'm only allowing access to a user called leon. It's also important to make sure the handlers are under the secured location.

<location path="elmah.axd">
        <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
        <allow users="leon"/>
        <deny users="*"/>
        <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/>

Also, in RegisterRoutes


See also