我试图让我的Azure Worker角色的日志出现在Application Insights中。当我运行Get-AzureServiceDiagnosticsExtension时,我得到以下内容......
<PublicConfig
xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="8192" sinks="applicationInsights.errors">
<DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Verbose" />
<PerformanceCounters scheduledTransferPeriod="PT1M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes"
sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time"
sampleRate="PT3M" />
</PerformanceCounters>
<WindowsEventLog scheduledTransferPeriod="PT1M">
<DataSource name="Application!*[System[(Level=1 or Level=2 or Level=3)]]" />
<DataSource name="Windows Azure!*[System[(Level=1 or Level=2 or Level=3 or Level=4)]]" />
</WindowsEventLog>
<EtwProviders sinks="applicationInsights" />
<CrashDumps dumpType="Full">
<CrashDumpConfiguration processName="WaAppAgent.exe" />
<CrashDumpConfiguration processName="WindowsAzureGuestAgent.exe" />
<CrashDumpConfiguration processName="WaWorkerHost.exe" />
<CrashDumpConfiguration processName="DiagnosticsAgent.exe" />
</CrashDumps>
<Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
<Metrics resourceId="/subscriptions/{My_Subscription_GUID}/resourceGroups/Group/providers/Microsoft.ClassicCompute/domainNames/MyCloudServiceName" />
</DiagnosticMonitorConfiguration>
<SinksConfig>
<Sink name="applicationInsights">
<ApplicationInsights />
<Channels>
<Channel logLevel="Verbose" name="errors" />
</Channels>
</Sink>
</SinksConfig>
</WadCfg>
<StorageAccount>myclassicstorage</StorageAccount>
</PublicConfig>
以下内容来自使用Set-AzureServiceDiagnosticsExtension上传的原始diagnostics.wadcfgx文件
<PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<StorageAccount name="{myclassicstorage}" key="{MyClassicStorageKey}" endpoint="https://myclassicstorage.blob.core.windows.net/" />
</PrivateConfig>
使用Azure存储资源管理器我可以连接到myclassicstorage,我可以在WADLogsTable中查看我想要的条目但是当我转到Application Insights时,没有...
因此,我的跟踪条目似乎正在进入存储,但我的Application Insights并未从存储中获取数据。
无论如何,问题的答案可能导致对失败的解释: -
是否选择&#34;存储帐户&#34;是否重要或者一个&#34;存储帐户(经典)&#34;
ServiceConfiguration.Local.cscfg和ServiceConfiguration.Cloud.cscfg中的Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString以及diagnostics.wadcfgx文件中的StorageAccount。为什么有3个地方可以设置存储空间以及你应该在这些地方放置什么(我已经设置了相同的细节)。
在许多示例中,diagnostics.wadcfgx文件中的StorageAccount将端点设置为https://core.windows.net应该将其设置为什么?
答案 0 :(得分:1)
嗯,它刚刚开始工作。我相信答案是改变EtwProviders配置如下......
<EtwProviders>
<EtwEventSourceProviderConfiguration provider="WaWorkerHost.exe">
<DefaultEvents />
</EtwEventSourceProviderConfiguration>
</EtwProviders>
通过查看发布到WADLogsTable的数据我得到了“WaWorkerHost.exe”
EventName =“MessageEvent”Message =“2016-06-01 03:17:50,924 [14] INFO myservice.TaskProcessing [(null)] - 核心已完成 - 下一个截止日期 2016-06-01T03:18:27.5430000“TraceSource =”WaWorkerHost.exe“