diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index c75fa87853..47fc4e4d30 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -336,11 +336,6 @@ namespace Tgstation.Server.Host.Core if (logger == null) throw new ArgumentNullException(nameof(logger)); - // Log the active configuration. - logger.LogTrace("Active Config:"); - foreach (var section in Configuration.GetChildren()) - logger.LogTrace("{0}: {1}", section.Key, section.Value); - logger.LogDebug("Content Root: {0}", hostingEnvironment.ContentRootPath); logger.LogTrace("Web Root: {0}", hostingEnvironment.WebRootPath); diff --git a/src/Tgstation.Server.Host/Core/ServerPortProivder.cs b/src/Tgstation.Server.Host/Core/ServerPortProivder.cs index a71dc72a29..ba4e5ef469 100644 --- a/src/Tgstation.Server.Host/Core/ServerPortProivder.cs +++ b/src/Tgstation.Server.Host/Core/ServerPortProivder.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; using System; using System.Linq; @@ -14,11 +15,30 @@ namespace Tgstation.Server.Host.Core /// Initializes a new instance of the . /// /// The to use. - public ServerPortProivder(IConfiguration configuration) + /// The to use. + public ServerPortProivder(IConfiguration configuration, ILogger logger) { if (configuration == null) throw new ArgumentNullException(nameof(configuration)); + // Log the active configuration. + logger.LogTrace("Active Config:"); + + void LogSection(IConfigurationSection section, string prefix) + { + prefix = $"{prefix}{section.Key}:"; + if (section.Value != null) + logger.LogTrace("{0} {1}", prefix, section.Value); + else + { + foreach (var child in section.GetChildren()) + LogSection(child, prefix); + } + } + + foreach (var section in configuration.GetChildren()) + LogSection(section, String.Empty); + var httpEndpoint = configuration .GetSection("Kestrel") .GetSection("EndPoints")