Question

I'm trying to setup ELMAH to log errors for our application. I have successfully added the modules and am having no problems loading the ErrorLog page (elmah.axd). However, Elmah isn't logging any test exceptions that I'm generating.

My web.config looks like this:

<configSections>
    <!-- Other stuff -->
    <sectionGroup name="elmah">
        <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
        <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
        <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
    </sectionGroup>
</configSections>

<elmah>
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" /> 
</elmah> 

<httpHandlers> 
    <!-- Other stuff -->
    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
</httpHandlers>

<httpModules>
    <!-- Other stuff -->
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules>

Hitting the test exception page http://localhost/elmah.axd/test generates a yellow screen, but no log entry.

Between the sample provided and the tutorial on DotNetSlackers I can't see anything wrong. Is there something I'm missing? I've also attempted to generate errors via Signaling, but that's not working either.

I am running this against DotNetNuke, and so that's where I'm currently thinking the problem lies.

Was it helpful?

Solution

I think what you need is to do is disable custom error messages in DotNetNuke.
1. Log on dnn Portal as host
2. Navigate to Host > Host Settings.
2. Go to the Basic Settings - Appearance section.
3. At Use Custom Error Messages, uncheck the check box.
4. Click Update.
This will disable DotNetNuke's error handler.

OTHER TIPS

Could be that DNN is swallowing the exceptions - does it have its own Exception handling mechanism?

I was using ELMAH with Monorail and ran into a similar issue - Castle MonoRail & ELMAH

FYI Someone else with the same problem.

DNN does process all exceptions, so that's probably the issue you're seeing. I believe it handles the Error event at the application level, logging everything to the database. I don't know of any way to turn this off, but I've never really tried that hard, either.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top