我正在開發Azure WorkerRole()。在計算模擬器控制檯中,我看到所有Trace.WriteLine()消息,但只有那些在OnStart()中生成的消息似乎會持久存儲。Trace.WriteLine()消息僅在Azure WorkerRole的OnStart()中持久
我ServiceConfiguration.Local.csfg有:
<Role name="MyWorkerRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
我WorkerRole.cs有:
public override void Run() {
Trace.WriteLine("Called from Run(), where does this trace go???", "Information");
// ... SNIP ...
}
public override bool OnStart() {
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
DiagnosticMonitor.Start("DiagnosticsConnectionString", dmc);
Trace.WriteLine("This trace appears in WADLogsTable", "Information");
return base.OnStart();
}
MonAgentHost崩潰。看起來像Azure中的錯誤。請參閱:http://qa.social.msdn.microsoft.com/Forums/en-US/windowsazuretroubleshooting/thread/3d06d8f5-adf3-47bb-8a14-d57226273d3c – Seth