Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging to multiple targets with Elmah

Tags:

logging

elmah

I have the following Elmah configuration:

<elmah>
    <security allowRemoteAccess="0" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah.Sql"  />
    <errorLog type="Elmah.MemoryErrorLog, Elmah" size="50"  />
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>

But I get this error when I run my application:

Sections must only appear once per config file. See the help topic for exceptions.

like image 893
kiran Avatar asked Jun 13 '11 21:06

kiran


1 Answers

You can only use one of each type of logger in Elmah. What you specify in the <errorLog> section is where Elmah logs it's data.

When you retrieve errors using the /elmah.axd handler it retrieves this data from the data source type specified in the <errorLog> section. It doesn't really make sense to have more than one, or at least it's not designed that way.

like image 140
Kev Avatar answered Nov 02 '22 10:11

Kev