问题
I deployed an application on Windows Azure, i activated the diagnostic monitor like follows :
public override bool OnStart()
{
CloudStorageAccount account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=[xxxxxx];AccountKey=[xxxxxxx]");
var config = DiagnosticMonitor.GetDefaultInitialConfiguration();
config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;
config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
DiagnosticMonitor.Start(account, config);
return base.OnStart();
}
My question is why the logs are not stored automatically in "WADLogsTable" until i use "Azure diagnostic Manager 2" for Cerebrata and i use the "On demand transfer"?
回答1:
I think your problem is that you haven't used SetCurrentConfiguration() with your GetDefaultInitialConfiguration() to finally save the transfer time and log level. You must use the set of these API as below:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
OR
GetCurrentConfiguration()
SetCurrentConfiguration()
It is also good to know the the differences between these two.
来源:https://stackoverflow.com/questions/10870665/azure-diagnostics-and-wadlogstable