Skip to content

Commit 722c000

Browse files
committed
To override nested keys through environment variables in shells that don’t support : in variable names, replace them with __ (double underscore).
1 parent 3124a49 commit 722c000

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,15 @@ public static void ReadFromAppSettings(this ExceptionlessConfiguration config) {
384384
/// </summary>
385385
/// <param name="config">The configuration object you want to apply the attribute settings to.</param>
386386
public static void ReadFromEnvironmentalVariables(this ExceptionlessConfiguration config) {
387-
string apiKey = GetEnvironmentalVariable("Exceptionless:ApiKey");
387+
string apiKey = GetEnvironmentalVariable("Exceptionless:ApiKey") ?? GetEnvironmentalVariable("Exceptionless__ApiKey");
388388
if (IsValidApiKey(apiKey))
389389
config.ApiKey = apiKey;
390390

391391
bool enabled;
392-
if (Boolean.TryParse(GetEnvironmentalVariable("Exceptionless:Enabled"), out enabled) && !enabled)
392+
if (Boolean.TryParse(GetEnvironmentalVariable("Exceptionless:Enabled") ?? GetEnvironmentalVariable("Exceptionless__Enabled"), out enabled) && !enabled)
393393
config.Enabled = false;
394394

395-
string serverUrl = GetEnvironmentalVariable("Exceptionless:ServerUrl");
395+
string serverUrl = GetEnvironmentalVariable("Exceptionless:ServerUrl") ?? GetEnvironmentalVariable("Exceptionless__ServerUrl");
396396
if (!String.IsNullOrEmpty(serverUrl))
397397
config.ServerUrl = serverUrl;
398398
}

0 commit comments

Comments
 (0)