private string retrieveSetting(String name)
{
string cloudconfig = null;
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
cloudconfig = ConfigurationManager.AppSettings.Get(name);
}
else
{
cloudconfig = CloudConfigurationManager.GetSetting(name);
}
if (!String.IsNullOrWhiteSpace(cloudconfig))
{
WriteDebugMessages(String.Format("Found Cloud Configuration settings for {0}", name));
return cloudconfig;
}
var appconfig = ConfigurationManager.AppSettings[name];
if (!String.IsNullOrWhiteSpace(appconfig))
{
WriteDebugMessages(String.Format("Found App Settings for {0}", name));
return appconfig;
}
var envconfig = Environment.GetEnvironmentVariable(name);
if (!String.IsNullOrWhiteSpace(envconfig))
{
WriteDebugMessages(String.Format("Found Enviromental Variable for {0}", name));
return envconfig;
}
WriteDebugMessages(String.Format("Unable to find Logentries Configuration Setting for {0}.", name));
return null;
}