ELMAH可以与Oracle.ManagedDataAccess一起使用吗?

时间:2017-04-03 07:44:16

标签: asp.net-mvc odp.net elmah

我有使用Oracle.ManagedDataAccess.dll连接Oracle数据库的ASP.NET MVC项目,所以我不需要在部署了应用程序的任何机器上安装Oracle客户端。是否有任何选项可以配置ELMAH以使用Oracle.ManagedDataAccess.dll? 换句话说,据我所知,ELMAH只能使用Oracle客户端吗?

2 个答案:

答案 0 :(得分:1)

The newest version of the Oracle error logger for ELMAH, actually supports both Oracle Client and Oracles own .NET client:

https://github.com/elmah/Elmah/blob/master/src/Elmah.Oracle/OracleErrorLog.cs#L429

的废话文字

还没有包含此错误记录器的ELMAH的2.x NuGet包。您可以从GitHub克隆ELMAH存储库,并通过源代码控制,internel NuGet服务器或MyGet进行分发。或者,您可以创建自己的错误日志实现:Writing custom error loggers for ELMAH

答案 1 :(得分:1)

这是我的web.config中的代码。

<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" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>

<modules runAllManagedModulesForAllRequests="true">
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
    </modules>
<system.webServer>
    <handlers>
      <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
</system.webServer>
<elmah>
    <security allowRemoteAccess="1" />
    <errorLog type="Elmah.OracleErrorLog, Elmah" connectionStringName="elmah-oracle" schemaOwner="" />
</elmah>
<add name="elmah-oracle" connectionString="USER ID=...;DATA SOURCE=...;PASSWORD=..." providerName="Oracle.DataAccess.Client" />