-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let IHostBuilder AddNLog work correctly with ${configsetting} #484
Conversation
7d712e7
to
3444976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please improve then naming and then it's ready to merge :)
@@ -112,8 +112,11 @@ public static LogFactory ConfigureNLog(this ILoggingBuilder builder, LoggingConf | |||
/// <param name="configFileName">Path to NLog configuration file, e.g. nlog.config. </param> | |||
public static ILoggingBuilder AddNLog(this ILoggingBuilder builder, string configFileName) | |||
{ | |||
ConfigureServicesNLog(null, builder.Services, serviceProvider => serviceProvider.GetService<IConfiguration>()); | |||
LogManager.LoadConfiguration(configFileName); | |||
ConfigureServicesNLog(null, builder.Services, (s, c) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use longer names then s
and c
. This isn't C ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a better way that got rid of short names.
Could you elaborate this a bit? Not sure what we are to improve here. |
My initial version of AddNLog loaded the NLog-config before By delaying the loading of NLog-config until |
clear! Thanks! |
IHostBuilder AddNLog attempt to setup ConfigSettingLayoutRenderer early
Increase the chance that fluent configuration will work.