publicoverridebool OnStart(){
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
double logTransferInterval =Convert.ToDouble(RoleEnvironment.GetConfigurationSettingValue("LogTransferInterval"));
// Set scheduled transfer interval for infrastructure logs to 1 minute
config.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = System.
TimeSpan.FromMinutes(logTransferInterval);
// Set scheduled transfer interval for user's Windows Azure Logs to 1 minute
config.WindowsEventLog.DataSources.Add(
"System!*");
config.WindowsEventLog.DataSources.Add(
"Application!*");
config.Logs.ScheduledTransferPeriod = System.
TimeSpan.FromMinutes(1);
//Decrypt the Storage AccountName and Key
string decryptAccountName = EncryptDecrypt.DecryptMsg(RoleEnvironment.GetConfigurationSettingValue("AccountName"));
string decryptAccountKey = EncryptDecrypt.DecryptMsg(RoleEnvironment.GetConfigurationSettingValue("AccountKey"));
StorageCredentialsAccountAndKey accountAndKey =
new StorageCredentialsAccountAndKey(decryptAccountName, decryptAccountKey);
CloudStorageAccount storageAccount =
new CloudStorageAccount(accountAndKey,true);
DiagnosticMonitor.Start(storageAccount, config);
CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSettingPublisher) =>
{
var connectionString = RoleEnvironment.GetConfigurationSettingValue(configName);
configSettingPublisher(connectionString);
}
);
// For information on handling configuration changes
RoleEnvironment.Changing += RoleEnvironmentChanging;
returnbase.OnStart();
}
In above code i have configured Encrypted storage account and storage key and now i am descripting the connection string and plug-in for logging .
But whenever I am trying to log something then it’s not logging
Your Help will be appreciated very much.
cpsingh