Share via


HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging<TBuilder> Method

Definition

Adds endpoint specific settings for the HttpLogging middleware.

public static TBuilder WithHttpLogging<TBuilder> (this TBuilder builder, Microsoft.AspNetCore.HttpLogging.HttpLoggingFields loggingFields, int? requestBodyLogLimit = default, int? responseBodyLogLimit = default) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithHttpLogging : 'Builder * Microsoft.AspNetCore.HttpLogging.HttpLoggingFields * Nullable<int> * Nullable<int> -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithHttpLogging(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, loggingFields As HttpLoggingFields, Optional requestBodyLogLimit As Nullable(Of Integer) = Nothing, Optional responseBodyLogLimit As Nullable(Of Integer) = Nothing) As TBuilder

Type Parameters

TBuilder

The type of endpoint convention builder.

Parameters

builder
TBuilder

The endpoint convention builder.

loggingFields
HttpLoggingFields

The HttpLoggingFields to apply to this endpoint.

requestBodyLogLimit
Nullable<Int32>

Sets the RequestBodyLogLimit for this endpoint. A value of -1 means use the default setting in RequestBodyLogLimit.

responseBodyLogLimit
Nullable<Int32>

Sets the ResponseBodyLogLimit for this endpoint. A value of -1 means use the default setting in ResponseBodyLogLimit.

Returns

TBuilder

The original convention builder parameter.

Exceptions

Thrown when requestBodyLogLimit or responseBodyLogLimit is less than 0.

Applies to