Skip to content

Commit

Permalink
LoadConfigurationFromSection should RegisterConfigSettings without co…
Browse files Browse the repository at this point in the history
…nfiguration assign
  • Loading branch information
snakefoot committed Sep 29, 2022
1 parent 0e69f8c commit c5e2a33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public static class SetupBuilderExtensions
/// </summary>
public static ISetupBuilder LoadConfigurationFromSection(this ISetupBuilder setupBuilder, Microsoft.Extensions.Configuration.IConfiguration configuration, string configSection = "NLog")
{
setupBuilder.SetupExtensions(ext => ext.RegisterConfigSettings());
if (!string.IsNullOrEmpty(configSection))
{
var nlogConfig = configuration.GetSection(configSection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public static class SetupExtensionsBuilderExtensions
public static ISetupExtensionsBuilder RegisterConfigSettings(this ISetupExtensionsBuilder setupBuilder, IConfiguration configuration)
{
ConfigSettingLayoutRenderer.DefaultConfiguration = configuration;
return setupBuilder.RegisterConfigSettings();
}

internal static ISetupExtensionsBuilder RegisterConfigSettings(this ISetupExtensionsBuilder setupBuilder)
{
return setupBuilder.RegisterLayoutRenderer<ConfigSettingLayoutRenderer>("configsetting").RegisterLayoutRenderer<MicrosoftConsoleLayoutRenderer>("MicrosoftConsoleLayout");
}
}
Expand Down

0 comments on commit c5e2a33

Please sign in to comment.