views:

206

answers:

1

I want to write this

<elmah>
    <errorlog type="Elmah.XmlFilerErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

or

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

however every place i tried putting this tag in i get an Unrecognized configuration section elmah. error. I found this question http://stackoverflow.com/questions/1337316/configuring-elmah-unrecognized-config-section-error however i tried that (solution at the bottom of the question) and still get the error. Where do i put this?

-edit- i found the issue. I didnt set <sectionGroup name="elmah"> properly. I couldnt find it online then remembered the demo had sqlite logging and i checked the demo config for clues.

+8  A: 

You need to add the section group. Something like this:

<sectionGroup name="elmah">
  <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
</sectionGroup>

Then you can add the elmah section anywhere inside the "configuration" tag (not inside any other tag).

Mattias Jakobsson