File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ private void CreateInstallation()
356
356
new AssemblyInfo { Name = "log4net" , Version = _log4netAssemblyVersion , }
357
357
] ,
358
358
ConfigFiles = [ ] ,
359
+ EnvironmentVariables = [ ] ,
359
360
} ;
360
361
361
362
var installation = new CreateInstallation
@@ -381,6 +382,13 @@ private void CreateInstallation()
381
382
} ) ;
382
383
}
383
384
385
+ // Include environment variables from all possible sources since we don't know in which context log4net is being executed.
386
+ EnvironmentVariablesHelper . GetElmahIoAppSettingsEnvironmentVariables ( ) . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
387
+ EnvironmentVariablesHelper . GetAspNetCoreEnvironmentVariables ( ) . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
388
+ EnvironmentVariablesHelper . GetDotNetEnvironmentVariables ( ) . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
389
+ EnvironmentVariablesHelper . GetAzureEnvironmentVariables ( ) . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
390
+ EnvironmentVariablesHelper . GetAzureFunctionsEnvironmentVariables ( ) . ForEach ( v => logger . EnvironmentVariables . Add ( v ) ) ;
391
+
384
392
_client . Installations . Create ( _logId . ToString ( ) , installation ) ;
385
393
}
386
394
catch ( Exception ex )
You can’t perform that action at this time.
0 commit comments