Azure虚拟机诊断事件日志级别

时间:2015-02-17 12:42:34

标签: event-log azure-virtual-machine azure-diagnostics

我正在尝试配置Azure VM(Windows Server 2012 R2)以将事件日志记录到Azure存储。

我使用了以下.wadcfg文件

<WadCfg>
<DiagnosticMonitorConfiguration> 
<WindowsEventLog scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1M">
<DataSource name="Application!*" />
</WindowsEventLog>
<PerformanceCounters scheduledTransferPeriod="PT5M">
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT1M" />
</PerformanceCounters>
</DiagnosticMonitorConfiguration>
</WadCfg>

我已经使用以下powershell脚本来安装它

$serviceName = "x"
$vmname = "x"
$diagnosticsFilePath = "x\diagnostics.wadcfg"
$storageName = "x"
$storageKey = (Get-AzureStorageKey $storageName).Primary
$storageAccount = New-AzureStorageContext -StorageAccountName $storageName -StorageAccountKey $storageKey

(Get-AzureVM -ServiceName $serviceName -Name $vmname) | Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $diagnosticsFilePath - StorageContext $storageAccount -Version 1.3 | Update-AzureVM

当我运行没有'scheduledTransferLogLevelFilter =“Verbose”'的脚本时,它运行正常。脚本完成,事件日志显示在存储中。但是当我尝试使用上面发布的wadcfg运行脚本时,我在VM上的应用程序事件日志中收到以下错误,源AzureDiagnostics。

  

Microsoft.Azure.Plugins.Plugin.WadConfigValidatorException:解析配置时出现异常:错误:未声明'scheduledTransferLogLevelFilter'属性。行:2列:18      在Microsoft.Azure.Plugins.Plugin.WadConfigValidator`1.Initialize(String configString,String schemaPath)      在Microsoft.Azure.Plugins.Plugin.WadParser.Parse()

接着是

  

无法解析WAD配置文件

最后

  

DiagnosticsPlugin启动失败,退出代码为-106

如果我尝试包含'bufferQuotaInMB =“0”',也会发生同样的事情。我无法弄清楚问题是什么。

我使用了以下来源,其中包括(我只能发布两个链接): http://blogs.msdn.com/b/cloud_solution_architect/archive/2015/01/26/azure-diagnostics-for-azure-virtual-machines.aspx

https://msdn.microsoft.com/en-us/library/hh411551.aspx

我可能只是忽略了一些简单的事情,但现在我被困住了。

0 个答案:

没有答案