.net Azure Diagnostics不存储数据,即使使用默认应用程序也是如此
我正在尝试将azure诊断数据存储在存储帐户上。 我尝试了以下代码:.net Azure Diagnostics不存储数据,即使使用默认应用程序也是如此,.net,azure,azure-storage,azure-diagnostics,.net,Azure,Azure Storage,Azure Diagnostics,我正在尝试将azure诊断数据存储在存储帐户上。 我尝试了以下代码: public override bool OnStart() { // For information on handling configuration changes // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. // Get the default initial co
public override bool OnStart()
{
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
// Get the default initial configuration for DiagnosticMonitor.
DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
// Filter the logs so that only error-level logs are transferred to persistent storage.
diagnosticConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;
// Schedule a transfer period of 30 minutes.
diagnosticConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
// Specify a buffer quota of 1GB.
diagnosticConfiguration.Logs.BufferQuotaInMB = 900;
// Start the DiagnosticMonitor using the diagnosticConfig and our connection string.
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfiguration);
Trace.TraceInformation("WebRole started");
return base.OnStart();
}
此代码与microsoft在MSDN上建议的代码相同
我试图注释掉BufferQuotaInMB,但没有成功。我已经在本地环境和实时部署中对新创建的应用程序进行了尝试。事实证明,即使是WADLogsTable也没有创建。我错过了什么
注意:它在windowsEventLogs的实时部署上运行正常。不确定出了什么问题,或者您可以尝试在代码中使用Diagnostics.wadcfg作为配置选项 很少有博客文章解释如何使用它: 如何使用Diagnostics.wadcfg配置Windows Azure Diagnostics集合: 通过diagnostics.wadcfg配置文件配置WAD: 如何使用Windows Azure诊断配置文件:
值得一试,对不起,我帮不上什么忙…不确定出了什么问题,您可以尝试在代码中使用Diagnostics.wadcfg作为配置选项吗 很少有博客文章解释如何使用它: 如何使用Diagnostics.wadcfg配置Windows Azure Diagnostics集合: 通过diagnostics.wadcfg配置文件配置WAD: 如何使用Windows Azure诊断配置文件:
值得一试,很抱歉,我帮不上什么忙…WadLogTable没有创建,因为我们的问题是您没有在GetDefaultInitialConfiguration()中使用SetCurrentConfiguration()来最终节省传输时间和日志级别。您必须使用以下API集:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
或
更多信息:未创建WadLogTable,因为我们的问题是您没有在GetDefaultInitialConfiguration()中使用SetCurrentConfiguration()来最终节省传输时间和日志级别。您必须使用以下API集:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
或
更多信息:不完全是我要找的,但它现在适用于事件日志。不完全是我要找的,但它现在适用于事件日志。