HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging<TBuilder> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
Sets the RequestBodyLogLimit for this endpoint. A value of -1
means use the default setting in RequestBodyLogLimit.
Sets the ResponseBodyLogLimit for this endpoint. A value of -1
means use the default setting in ResponseBodyLogLimit.
Returns
The original convention builder parameter.
Exceptions
Thrown when requestBodyLogLimit
or responseBodyLogLimit
is less than 0
.