public LoggerMiddleware(ILogger <LoggerMiddleware> logger, IOptions <LoggerMiddlewareOptions> options) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); _recyclableMemoryStreamManager = new RecyclableMemoryStreamManager(); }
public static IAppBuilder UseLoggerMiddleware(this IAppBuilder app, LoggerMiddlewareOptions options) { return(app.Use <LoggerMiddleware>(options)); }