私の Azure アプリでは、アプリケーションの動作を追跡するために Trace.WriteLine() 呼び出しが散りばめられています。
私を悩ませているのは、これらのいくつかはログに記録され、他のものは記録されないということです。たとえば、ワーカー ロールの OnStart() メソッドからのこのコード スニペットは次のとおりです。
Trace.WriteLine("WorkerRole: creating storage tables", "Information");
CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
CloudTableClient tableClient = account.CreateCloudTableClient();
if (tableClient.CreateTableIfNotExist("Devices")) {
Trace.WriteLine("WorkerRole.OnStart: Devices table created", "Information");
}else{
Trace.WriteLine("WorkerRole.OnStart: Devices table not created. Already exists?", "Information");
}
最初のトレースがログに記録されます。if ステートメントの Trace 呼び出しのどちらもログに記録されませんでした。次に、その後に実行されるメソッドの Trace メソッドがログに記録されます。
何か案は?