コード例 #1
0
 public RequestLoggingMiddleware(
     RequestLoggingOptions options,
     RequestDelegate next)
 {
     _next    = next ?? throw new ArgumentNullException(nameof(next));
     _options = options ?? throw new ArgumentNullException(nameof(options));
 }
コード例 #2
0
        /// <summary>
        /// <para>Logs the current HTTP request when enabled.</para>
        /// </summary>
        public static IApplicationBuilder UseRequestLogging(
            this IApplicationBuilder builder,
            Action <RequestLoggingOptions> configureOptions)
        {
            var options = new RequestLoggingOptions();

            configureOptions(options);
            return(builder.UseMiddleware <RequestLoggingMiddleware>(options));
        }