public static ILogger AddEarlyLogging(this IServiceCollection services) { var earlyLogger = new EarlyLogger(); services.AddSingleton <IStartupFilter>(sp => new EarlyLoggingStartupFilter(earlyLogger, sp.GetRequiredService <ILogger <EarlyLogger> >())); return(earlyLogger); }
public EarlyLoggingStartupFilter(EarlyLogger earlyLogger, ILogger <EarlyLogger> logger) { this.earlyLogger = earlyLogger; this.logger = logger; }