/// <summary> /// Configures logging to use the specified <see cref="LoggerConfiguration"/>. /// </summary> /// <param name="builder">The logging extension builder.</param> /// <param name="config">The logger configuration to use.</param> /// <returns>The <paramref name="builder"/>.</returns> public static IFacilityExtensionBuilder <ILoggingFacility, SerilogLoggingExtension> UseConfiguration( this IFacilityExtensionBuilder <ILoggingFacility, SerilogLoggingExtension> builder, LoggerConfiguration config) { Ensure.Arg.NotNull(builder, nameof(builder)); builder.Configure( (f, e) => { e.Logger = config.CreateLogger(); e.Dispose = true; }); return(builder); }
/// <summary> /// Configures logging to use the specified <see cref="Serilog.ILogger"/>. /// </summary> /// <param name="builder">The logging extension builder.</param> /// <param name="logger">The root logger to use.</param> /// <param name="dispose">Whether to dispose the logger.</param> /// <returns>The <paramref name="builder"/>.</returns> public static IFacilityExtensionBuilder <ILoggingFacility, SerilogLoggingExtension> UseLogger( this IFacilityExtensionBuilder <ILoggingFacility, SerilogLoggingExtension> builder, ILogger logger, bool dispose = false) { Ensure.Arg.NotNull(builder, nameof(builder)); builder.Configure( (f, e) => { e.Logger = logger; e.Dispose = dispose; }); return(builder); }
public void Configure(Action <IDataFacility, EntityFrameworkCoreExtension <TTag, TDbContext> > configure) { _builder.Configure(configure); }