예제 #1
0
        public static ILogger AddEarlyLogging(this IServiceCollection services)
        {
            var earlyLogger = new EarlyLogger();

            services.AddSingleton <IStartupFilter>(sp => new EarlyLoggingStartupFilter(earlyLogger, sp.GetRequiredService <ILogger <EarlyLogger> >()));
            return(earlyLogger);
        }
예제 #2
0
 public EarlyLoggingStartupFilter(EarlyLogger earlyLogger, ILogger <EarlyLogger> logger)
 {
     this.earlyLogger = earlyLogger;
     this.logger      = logger;
 }