【问题标题】:How to use Azure storage for elmah logs instead of elmah logs in SQL Server database如何在 SQL Server 数据库中将 Azure 存储用于 elmah 日志而不是 elmah 日志
【发布时间】:2018-12-19 08:57:50
【问题描述】:

目前在我的项目中,我在 SQL Server 的单独表中使用 elmah 记录异常。是否可以仅将这些 elmah 异常存储在 Azure 存储中,而不是存储在 SQL Server 中?因为我不想在我的数据库中记录错误。

//web.config     
<elmah>
    <security allowRemoteAccess="1" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" 
              connectionStringName="DatabaseConnectionStringName" />
</elmah>    

目前在我的web.config 中,我在 SQL Server 中配置了 elmah 日志。

设置 allowRemoteAccess = 1 并添加错误日志类型为Elmah.SqlErrorLog。能 有人帮忙吗?

提前致谢。

【问题讨论】:

    标签: asp.net-mvc azure-storage elmah.mvc


    【解决方案1】:

    有可能,我们可以在 Azure 表存储中存储 elmah 异常。

    我们需要使用这个包:Elmah.AzureTableStorage

    我们可以通过 VS 包管理器安装这个:Install-Package Elmah.AzureTableStorage -Version 1.0.0

    在web.config中,我们可以设置如下:

    <errorLog type="Elmah.AzureTableStorage.AzureTableStorageErrorLog, Elmah.AzureTableStorage"
    connectionStringName="ElmahAzureTableStorage" />
    

    我已经测试过和我的登录表存储截图供大家参考:

    更多信息供您参考:

    GitHub: Elmah.AzureTableStorage

    ELMAH on Azure Table Storage

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-26
      • 2021-12-31
      • 2011-08-29
      • 1970-01-01
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 2010-12-01
      相关资源
      最近更新 更多