我在我的 Azure PHP Web 角色中启用了诊断。它似乎确实已启用,因为它正在创建两个表WADDiagnosticInfraestructureLogsTable
和WADWindowsEventsLogTable
,以及将配置转储到 blob 容器中wad-control-container
。
PerformanceCounters
但它不是为 my 的其他两个部分(和Logs
)创建表diagnostics.wadcfg
。我究竟做错了什么?
这是我的diagnostics.wadcfg
:
<DiagnosticMonitorConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration" configurationChangePollInterval="PT1M" overallQuotaInMB="4096">
<DiagnosticInfrastructureLogs bufferQuotaInMB="1024" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1M" />
<Logs bufferQuotaInMB="1024" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1M" />
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1M">
<DataSource name="Application!*"/>
<DataSource name="System!*"/>
</WindowsEventLog>
<PerformanceCounters bufferQuotaInMB="1024" scheduledTransferPeriod="PT2M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT1M"/>
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT1M"/>
<PerformanceCounterConfiguration counterSpecifier="\Network Interface(*)\Bytes Sent/sec" sampleRate="PT1M"/>
<PerformanceCounterConfiguration counterSpecifier="\Network Interface(*)\Bytes Total/sec" sampleRate="PT1M"/>
</PerformanceCounters>
</DiagnosticMonitorConfiguration>
这是 Azure 诊断转储到我的 Blob 存储中的配置文件:
<?xml version="1.0"?>
<ConfigRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DataSources>
<OverallQuotaInMB>4096</OverallQuotaInMB>
<Logs>
<BufferQuotaInMB>1024</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>1</ScheduledTransferPeriodInMinutes>
<ScheduledTransferLogLevelFilter>Verbose</ScheduledTransferLogLevelFilter>
</Logs>
<DiagnosticInfrastructureLogs>
<BufferQuotaInMB>1024</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>1</ScheduledTransferPeriodInMinutes>
<ScheduledTransferLogLevelFilter>Verbose</ScheduledTransferLogLevelFilter>
</DiagnosticInfrastructureLogs>
<PerformanceCounters>
<BufferQuotaInMB>1024</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>2</ScheduledTransferPeriodInMinutes>
<Subscriptions>
<PerformanceCounterConfiguration>
<CounterSpecifier>\Memory\Available MBytes</CounterSpecifier>
<SampleRateInSeconds>60</SampleRateInSeconds>
</PerformanceCounterConfiguration>
<PerformanceCounterConfiguration>
<CounterSpecifier>\Processor(_Total)\% Processor Time</CounterSpecifier>
<SampleRateInSeconds>60</SampleRateInSeconds>
</PerformanceCounterConfiguration>
<PerformanceCounterConfiguration>
<CounterSpecifier>\Network Interface(*)\Bytes Sent/sec</CounterSpecifier>
<SampleRateInSeconds>60</SampleRateInSeconds>
</PerformanceCounterConfiguration>
<PerformanceCounterConfiguration>
<CounterSpecifier>\Network Interface(*)\Bytes Total/sec</CounterSpecifier>
<SampleRateInSeconds>60</SampleRateInSeconds>
</PerformanceCounterConfiguration>
</Subscriptions>
</PerformanceCounters>
<WindowsEventLog>
<BufferQuotaInMB>1024</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>1</ScheduledTransferPeriodInMinutes>
<Subscriptions>
<string>Application!*</string>
<string>System!*</string>
</Subscriptions>
<ScheduledTransferLogLevelFilter>Verbose</ScheduledTransferLogLevelFilter>
</WindowsEventLog>
<Directories>
<BufferQuotaInMB>0</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>0</ScheduledTransferPeriodInMinutes>
<Subscriptions />
</Directories>
</DataSources>
<IsDefault>true</IsDefault>
</ConfigRequest>
在我的ServiceConfiguration.cscfg
我有这个:
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="[myconnectionstring]"/>
[...]
</ConfigurationSettings>
在我的ServiceDefinition.csdef
:
<Imports>
<Import moduleName="Diagnostics"/>
</Imports>