views:

1048

answers:

3

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.

+1  A: 

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 - http://stackoverflow.com/questions/275810/castle-monorail-elmah

FYI Someone else with the same problem.

Macka
Yeah, I just stumbled on that link too!
Gavin Miller
I noticed in your question you used signaling to solve your problem -- even that isn't working on my box.
Gavin Miller
Afraid I don't know too much about DNN, but have you tried disabling the DNN logging module?
Macka
I'm looking into that right now
Gavin Miller
+1  A: 

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.

bdukes
Ya, it's figuring out how to turn it off that's the trouble. DNN documentation is poor at best!
Gavin Miller
+4  A: 

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.

notandy
Beautiful! That did the trick.
Gavin Miller
Worked great with dnn 5.04
Chris Lively