예제 #1
0
        /// <summary>
        /// Uses the request logging.
        /// </summary>
        /// <param name="builder">The builder.</param>
        /// <param name="configure">The configure.</param>
        /// <returns>IApplicationBuilder.</returns>
        /// <autogeneratedoc />
        public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder builder, Action <RequestLoggingOptions>?configure = null)
        {
            var options = new RequestLoggingOptions();

            configure?.Invoke(options);
            builder.UseMiddleware <RequestLogging>(options);
            return(builder);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestLogging" /> class.
 /// </summary>
 /// <param name="next">The next RequestDelegate in the pipeline.</param>
 /// <param name="telemetry">The Application Insights telemetry client.</param>
 /// <param name="options">The options.</param>
 /// <exception cref="ArgumentNullException">next</exception>
 public RequestLogging(RequestDelegate next, TelemetryClient telemetry, RequestLoggingOptions options)
 {
     _next      = next ?? throw new ArgumentNullException(nameof(next));
     _telemetry = telemetry;
     _options   = options;
 }