Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrBogomips/e8b0593ac5560372e8a9640dd2d18cf0 to your computer and use it in GitHub Desktop.
Save MrBogomips/e8b0593ac5560372e8a9640dd2d18cf0 to your computer and use it in GitHub Desktop.
C# Environment Variables Logger Function
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