@@ -135,22 +135,10 @@ public static void CreateInstallation(IApplicationBuilder app)
135135 }
136136 }
137137
138- // elmah.io environment variables
139- if ( TryGetEnvironmentVariable ( [ "ElmahIo:LogId" , "ElmahIo__LogId" ] , out string logIdEnv ) ) logger . EnvironmentVariables . Add ( new Item ( "ElmahIo:LogId" , logIdEnv ) ) ;
140- if ( TryGetEnvironmentVariable ( [ "ElmahIo.ApiKey" , "ElmahIo__ApiKey" ] , out string apiKeyEnv ) ) logger . EnvironmentVariables . Add ( new Item ( "ElmahIo:ApiKey" , apiKeyEnv ) ) ;
141-
142- // ASP.NET Core environment variables
143- if ( TryGetEnvironmentVariable ( [ "ASPNETCORE_ENVIRONMENT" ] , out string aspNetCoreEnvironment ) ) logger . EnvironmentVariables . Add ( new Item ( "ASPNETCORE_ENVIRONMENT" , aspNetCoreEnvironment ) ) ;
144- if ( TryGetEnvironmentVariable ( [ "DOTNET_ENVIRONMENT" ] , out string dotNetEnvironment ) ) logger . EnvironmentVariables . Add ( new Item ( "DOTNET_ENVIRONMENT" , dotNetEnvironment ) ) ;
145- if ( TryGetEnvironmentVariable ( [ "DOTNET_VERSION" ] , out string dotNetVersion ) ) logger . EnvironmentVariables . Add ( new Item ( "DOTNET_VERSION" , dotNetVersion ) ) ;
146- if ( TryGetEnvironmentVariable ( [ "PROCESSOR_ARCHITECTURE" ] , out string processorArchitecture ) ) logger . EnvironmentVariables . Add ( new Item ( "PROCESSOR_ARCHITECTURE" , processorArchitecture ) ) ;
147-
148- // Azure environment variables
149- if ( TryGetEnvironmentVariable ( [ "WEBSITE_SITE_NAME" ] , out string websiteSiteName ) ) logger . EnvironmentVariables . Add ( new Item ( "WEBSITE_SITE_NAME" , websiteSiteName ) ) ;
150- if ( TryGetEnvironmentVariable ( [ "WEBSITE_RESOURCE_GROUP" ] , out string websiteResourceGroup ) ) logger . EnvironmentVariables . Add ( new Item ( "WEBSITE_RESOURCE_GROUP" , websiteResourceGroup ) ) ;
151- if ( TryGetEnvironmentVariable ( [ "WEBSITE_OWNER_NAME" ] , out string websiteOwnerName ) ) logger . EnvironmentVariables . Add ( new Item ( "WEBSITE_OWNER_NAME" , websiteOwnerName ) ) ;
152- if ( TryGetEnvironmentVariable ( [ "REGION_NAME" ] , out string regionName ) ) logger . EnvironmentVariables . Add ( new Item ( "REGION_NAME" , regionName ) ) ;
153- if ( TryGetEnvironmentVariable ( [ "WEBSITE_SKU" ] , out string websiteSku ) ) logger . EnvironmentVariables . Add ( new Item ( "WEBSITE_SKU" , websiteSku ) ) ;
138+ if ( EnvironmentVariablesHelper . TryGetElmahIoAppSettingsEnvironmentVariables ( out List < Item > elmahIoVariables ) ) elmahIoVariables . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
139+ if ( EnvironmentVariablesHelper . TryGetAspNetCoreEnvironmentVariables ( out List < Item > aspNetCoreVariables ) ) aspNetCoreVariables . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
140+ if ( EnvironmentVariablesHelper . TryGetDotNetEnvironmentVariables ( out List < Item > dotNetVariables ) ) dotNetVariables . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
141+ if ( EnvironmentVariablesHelper . TryGetAzureEnvironmentVariables ( out List < Item > azureVariables ) ) azureVariables . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
154142
155143 var elmahioApi = ElmahioAPI . Create ( options . ApiKey , new Client . ElmahIoOptions
156144 {
0 commit comments