You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since both properties of BaseBuilder are protected internal, it is difficult to add custom ILoggerProvider instances to the default LoggerFactory in the connection.
I understand there is an extension method to provide a new instance of LoggerFactory, but in my case, I'd rather keep the LoggerFactory that the connection is using separate from the LoggerFactory that the rest of the app is using. However, I'd like to inject a LoggerProvider (i.e. Serilog) so the behavior of the logging can be managed via configuration.
I think the easiest solution would be an additional extension method in Xeeny.Extensions.Loggers.BaseBuilderExtenions.
public static TBuilder WithCustomLoggerProvider<TBuilder>(this TBuilder builder, ILoggerProvider provider)
where TBuilder : BaseBuilder
{
builder.LoggerFactory.AddProvider(provider);
return builder;
}
The text was updated successfully, but these errors were encountered:
bobted
changed the title
Expose BaseBuilder.LoggerFactory with a public getter
Allow custom logger providers
May 31, 2018
Since both properties of BaseBuilder are protected internal, it is difficult to add custom ILoggerProvider instances to the default LoggerFactory in the connection.
I understand there is an extension method to provide a new instance of LoggerFactory, but in my case, I'd rather keep the LoggerFactory that the connection is using separate from the LoggerFactory that the rest of the app is using. However, I'd like to inject a LoggerProvider (i.e. Serilog) so the behavior of the logging can be managed via configuration.
I think the easiest solution would be an additional extension method in Xeeny.Extensions.Loggers.BaseBuilderExtenions.
The text was updated successfully, but these errors were encountered: