public static IApplicationBuilder UseAccessLogging(this IApplicationBuilder builder, Action <AccessLogOptions> configureOptions)
        {
            var options = new AccessLogOptions();

            configureOptions(options);

            return(builder.UseMiddleware <AccessLogMiddleware>(options));
        }
        public AccessLogMiddleware(RequestDelegate next, ILogger <AccessLogMiddleware> logger, AccessLogOptions options)
        {
            _next   = next;
            _logger = logger;

            // Options
            _logLevel = options.LogLevel;
            if (!string.IsNullOrEmpty(options.StatusCodes))
            {
                var range = IntRange.ParseRange(options.StatusCodes);
                if (range.Length > 0)
                {
                    _statusCodes = range;
                }
            }
        }