Created
December 5, 2020 11:00
-
-
Save MrBogomips/e8b0593ac5560372e8a9640dd2d18cf0 to your computer and use it in GitHub Desktop.
C# Environment Variables Logger Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void LogEnvironmentInfo(ILogger<YOUR_CLASS> log) { | |
var envs = Environment.GetEnvironmentVariables(); | |
StringBuilder sb = new StringBuilder(); | |
foreach (var k in envs.Keys) sb.AppendLine($"{k}: {envs[k]}"); | |
log.LogInformation(sb.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment