开发者

Logging to multiple targets with Elmah

开发者 https://www.devze.com 2023-03-12 10:09 出处:网络
I have the following Elmah configuration: <elmah> <security allowRemoteAccess=\"0\" /> 开发者_JS百科<errorLog type=\"Elmah.SqlErrorLog, Elmah\" connectionStringName=\"Elmah.Sql\"/>

I have the following Elmah configuration:

<elmah>
    <security allowRemoteAccess="0" />
    开发者_JS百科<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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消