我想在Windows Azure診斷中使用跟蹤偵聽器來記錄某些消息。我能夠看到診斷程序在永久存儲上創建的blob,但我無法看到跟蹤偵聽器的輸出。Windows Azure:無法在診斷日誌中看到跟蹤偵聽器的輸出
這是我在輔助角色OnStart方法嘗試:
var config = DiagnosticMonitor.GetDefaultInitialConfiguration();
config.Logs.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(1.0);
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener());
System.Diagnostics.Trace.AutoFlush = true;
System.Diagnostics.Trace.Write("some logging");
幾天前我回答了一個類似的問題:http://stackoverflow.com/questions/15672003/how-to-log-messages-to-the-windows-azure-storage/15673515#15673515。 HTH。 –