【问题标题】:Microsoft.WindowsAzure.Storage and ETWMicrosoft.WindowsAzure.Storage 和 ETW
【发布时间】:2017-04-05 14:59:48
【问题描述】:

外部 dll 挂起,我认为这是由 Microsoft.WindowsAzure.Storage dll 引起的。由于我的应用程序依赖于Microsoft.WindowsAzure.Storage dll,我想知道是否可以利用 ETW 从Microsoft.WindowsAzure.Storage dll 输出日志?

【问题讨论】:

    标签: c# azure logging dll azure-storage


    【解决方案1】:

    我想知道是否可以利用 ETW 从 Microsoft.WindowsAzure.Storage dll 输出日志?

    Azure 存储客户端库允许我们记录来自客户端的 Azure 存储请求。我们可以看到您的客户端发送到 Azure 存储服务的请求的详细信息以及它从日志中收到的响应。要启用它,我们需要在 app.config 或 web.config 文件中配置诊断源。您可以使用以下配置将输出日志发送到 ETW。

    <system.diagnostics>                                                                         
      <sources>
        <source name="Microsoft.WindowsAzure.Storage">
          <listeners>
            <add name="EventLogListener" />
          </listeners>
        </source>
      </sources>
      <switches>
        <add name="Microsoft.WindowsAzure.Storage" value="Verbose" />
      </switches>
      <sharedListeners>
        <add name="EventLogListener" type="System.Diagnostics.EventLogTraceListener"
                            initializeData="AzureStorageLog" />
      </sharedListeners>
    </system.diagnostics>
    

    另外,使上层配置工作。运行您的应用程序的用户需要有足够的权限将日志添加到 Windows 事件日志。在我这边,我需要以管理员身份运行我的示例应用程序。

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 2012-11-18
      • 2021-08-13
      • 2022-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-18
      • 1970-01-01
      相关资源
      最近更新 更多