共用方式為


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 擲回 。

適用於