Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging<TBuilder> Method

Definition

Namespace:
Microsoft.AspNetCore.Builder
Assembly:
Microsoft.AspNetCore.HttpLogging.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
HttpLoggingEndpointConventionBuilderExtensions.cs

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.

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


Feedback

Was this page helpful?