Explorar o código

Log 'JELLYFIN_' environment variables at application start

Mark Monteiro %!s(int64=5) %!d(string=hai) anos
pai
achega
885bc11b67
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      Emby.Server.Implementations/ApplicationHost.cs

+ 12 - 0
Emby.Server.Implementations/ApplicationHost.cs

@@ -897,6 +897,18 @@ namespace Emby.Server.Implementations
                 .GetCommandLineArgs()
                 .Distinct();
 
+            // Get all 'JELLYFIN_' prefixed environment variables
+            var allEnvVars = Environment.GetEnvironmentVariables();
+            var jellyfinEnvVars = new Dictionary<object, object>();
+            foreach (var key in allEnvVars.Keys)
+            {
+                if (key.ToString().StartsWith("JELLYFIN_", StringComparison.OrdinalIgnoreCase))
+                {
+                    jellyfinEnvVars.Add(key, allEnvVars[key]);
+                }
+            }
+
+            logger.LogInformation("Environment Variables: {EnvVars}", jellyfinEnvVars);
             logger.LogInformation("Arguments: {Args}", commandLineArgs);
             logger.LogInformation("Operating system: {OS}", OperatingSystem.Name);
             logger.LogInformation("Architecture: {Architecture}", RuntimeInformation.OSArchitecture);