I am using Azure sdk 1.4 and am trying to set up the diagnostics on my web role. Here is what I have done in the webrole's onstart method:
string wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));
RoleInstanceDiagnosticManager roleInstanceDiagnosticManager = storageAccount.CreateRoleInstanceDiagnosticManager(RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name, RoleEnvironment.CurrentRoleInstance.Id);
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
int loggingInterval = Int32.Parse(RoleEnvironment.GetConfigurationSettingValue("loggingInterval"));
config.Logs.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(loggingInterval);
config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
roleInstanceDiagnosticManager.SetCurrentConfiguration(config);
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
RoleEnvironment.Changing += RoleEnvironmentChanging;
Now, when I run this on the cloud emulator on my dev machine - it works fine, I can see the logs going in the WADLogs table. I have set the "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value in my cscfg file to be "UseDevelopmentStorage=true". When I publish my webrole to the azure cloud, I set this config value to properly point to the correct storage account:
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=acctname;AccountKey=acctKey" />
However, my webrole logs never show up on the azure cloud. When I run the cloud app on the emulator and point the diagnostics connection string to the live cloud storage, even then I am able to get the diagnostics. Can someone let me know whats going on?
Kapil