HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging<TBuilder> 方法

定义

为 HttpLogging 中间件添加特定于终结点的设置。

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

类型参数

TBuilder

终结点约定生成器的类型。

参数

builder
TBuilder

终结点约定生成器。

loggingFields
HttpLoggingFields

HttpLoggingFields要应用于此终结点的 。

requestBodyLogLimit
Nullable<Int32>

RequestBodyLogLimit设置此终结点的 。 值 表示 -1 使用 中的 RequestBodyLogLimit默认设置。

responseBodyLogLimit
Nullable<Int32>

ResponseBodyLogLimit设置此终结点的 。 值 表示 -1 使用 中的 ResponseBodyLogLimit默认设置。

返回

TBuilder

原始约定生成器参数。

例外

当 或 responseBodyLogLimit 小于 0requestBodyLogLimit引发。

适用于