Azure的SDK,Trace.Information和WADLogsTable [英] Azure SDK, Trace.Information and WADLogsTable

查看:318
本文介绍了Azure的SDK,Trace.Information和WADLogsTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET中使用的Azure SDK 2.5编写一个新的云服务。
我知道,已经有过诊断一些显著的变化与2.5 SDK rekesae

I am writing a new Cloud Service in .NET using Azure SDK 2.5. I'm aware that there have been some significant changes to diagnostics with the 2.5 SDK rekesae.

在哪里我得到相互矛盾的信息,我是否可以仍然使用Azure诊断捕获跟踪*输出到 WADLogsTable 天青表的存储?

Where I am getting conflicting information is whether or not I can still use Azure Diagnostics to capture Trace.* output to WADLogsTable in Azure Table Storage?

我知道,我可以使用ETW作为替代,但现在我要问的。

I'm aware that I can use ETW as an alternative, but that's now what I'm asking for.

据<一个href=\"http://azure.microsoft.com/en-in/documentation/articles/cloud-services-dotnet-diagnostics/#comparing\">this文章中,我仍然可以使用跟踪捕捉到我的日志与Azure诊断1.3 - 我的理解已经随SDK 2.5

According to this article I can still use Trace to capture my logs with Azure Diagnostics 1.3 - which I understand has shipped with SDK 2.5.

可惜我不能得到它的工作。

Unfortunately I cannot get it to work.

我的工人角色的app.config如下:

The app.config of my worker role looks like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
    <trace>
        <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="AzureDiagnostics">
                <filter type="" />
            </add>
        </listeners>
    </trace>
</system.diagnostics>
</configuration>

纵观我的工人角色code我已经跟踪code,看起来像这样:

Throughout the code in my worker role I have tracing code that looks like this:

Trace.TraceInformation("Something happened");

我的公共diagnostics.wadcfg文件看起来像这样:

My public diagnostics.wadcfg file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<PublicConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
  <DiagnosticMonitorConfiguration overallQuotaInMB="4096">
    <Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Information" />
  </DiagnosticMonitorConfiguration>
</WadCfg>
<StorageAccount>mystorageAccount</StorageAccount>
</PublicConfig>

我已经使用这个文件中使用PowerShell命令来配置诊断服务扩展:

I have used this file to configure the diagnostics service extension using the PowerShell command:

Set-AzureServiceDiagnosticsExtension

没有WADLogsTable被创建。
如果启用其他诊断服务,如性能计数器那么相关表(WADPerformanceCountersTable)的创建和填充。

No WADLogsTable is ever created. If I enable other diagnostics services such as Perf Counter then the relevant tables (WADPerformanceCountersTable) are created and populated.

我使用的:


  • 的Visual Studio 2012

  • .NET 4.5.1

  • 天青Powershell的(从Web平台安装最新的V)

  • 的Azure SDK 2.5

谁能把我从我的痛苦?
非常感谢

Can anyone put me out of my misery? Many Thanks

推荐答案

你是如何部署?在相同的设置(VS2012,天青2.5 SDK),我只看到了WADLogsTable使用Visual Studio发布向导,这显然配置诊断扩展你所得到创建。参见:

How are you deploying? On the same setup (VS2012, Azure 2.5 SDK), I only saw the WADLogsTable get created using the Visual Studio "Publish" wizard, which apparently configures the diagnostics extension for you. See:

https://msdn.microsoft.com/en-us/库/天蓝色/ dn873976.aspx

诊断配置必须单独部署后应用 - 由于Azure的SDK 2.5版使用扩展模式,诊断扩展和配置部署包不再一部分,并且必须在部署后单独应用。当您使用发布向导部署应用程序的 Visual Studio会为你申请的延伸和配置的[...]

Diagnostics configuration must be applied separately after deployment - Because Azure SDK version 2.5 uses the extension model, the diagnostics extension and configuration are no longer part of the deployment package and must be applied separately after the deployment. Visual Studio will apply the extension and configuration for you when you use the Publish wizard to deploy your application [...]

我是不是能够得到PowerShell命令工作(并没有把太多精力花在了,说实话),但作为一种解决方法,当我使用VS部署的发布向导中,WADLogsTable创建和我可以看我的日志流动。当我打包并上传通过Azure的门户网站这并没有发生。

I wasn't able to get the PowerShell cmdlets to work (didn't put much effort into that, honestly) but as a workaround, when I deployed using the VS "Publish" wizard, the WADLogsTable was created and I could see my logs flowing. This didn't happen when I packaged and uploaded through the Azure Portal.

这可能是这样,在可预见的未来;的情况似乎并不在2.6 SDK来已经改变(尽管它们固定了很多在2.5诊断irksomeness的): https://msdn.microsoft.com/en-us/library/azure/dn186185.aspx

It may be this way for the foreseeable future; the situation doesn't seem to have changed in the 2.6 SDK (though they fixed a lot of the irksomeness with diagnostics in 2.5): https://msdn.microsoft.com/en-us/library/azure/dn186185.aspx

这篇关于Azure的SDK,Trace.Information和WADLogsTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆