【发布时间】:2013-03-20 17:03:55
【问题描述】:
我想在 Windows azure 诊断程序中使用跟踪侦听器记录一些消息。我可以看到诊断在我的永久存储上创建的 blob,但我看不到跟踪侦听器的输出。
这是我在工作角色 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");
【问题讨论】:
-
前几天我回答了一个类似的问题:stackoverflow.com/questions/15672003/…。 HTH。
标签: .net azure azure-storage azure-blob-storage azure-diagnostics