ข้ามไปยังเนื้อหา

Class HttpRequestResponseLoggingOptions

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.AspNetCore.Hosting
Assembly: Cephalon.AspNetCore.dll

Configures opt-in HTTP request and response logging for Cephalon ASP.NET Core hosts.

public sealed class HttpRequestResponseLoggingOptions

objectHttpRequestResponseLoggingOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

These settings are read from Engine:Observability:HttpLogging by default. Request and response bodies are captured only for textual content types such as JSON, XML, GraphQL, form payloads, and text/* responses, and body capture is truncated to the configured limits. Sensitive query-string and payload fields can also be redacted before the log event is written, including JSON, form, and header-style plain-text key/value content.

Creates request and response logging options with body capture disabled by default.

public HttpRequestResponseLoggingOptions()

Gets or sets a value indicating whether the ASP.NET Core host should log request and response summaries.

public bool Enabled { get; set; }

bool

Gets or sets a value indicating whether textual request bodies should be logged.

public bool LogRequestBody { get; set; }

bool

Gets or sets a value indicating whether textual response bodies should be logged.

public bool LogResponseBody { get; set; }

bool

Gets or sets a value indicating whether known-sensitive query-string and payload fields should be redacted before logging.

public bool RedactSensitiveValues { get; set; }

bool

Gets or sets the field names that should be treated as sensitive when request and response content is logged.

public IReadOnlyList<string> RedactedFieldNames { get; set; }

IReadOnlyList<string>

Gets or sets the placeholder written to logs when a sensitive value is redacted.

public string RedactionValue { get; set; }

string

Gets or sets the maximum number of request-body characters to log before the payload is truncated.

public int RequestBodyLimit { get; set; }

int

Gets or sets the maximum number of response-body characters to log before the payload is truncated.

public int ResponseBodyLimit { get; set; }

int

FromConfiguration(IConfiguration, string)

Section titled “ FromConfiguration(IConfiguration, string)”

Binds request and response logging options from configuration.

public static HttpRequestResponseLoggingOptions FromConfiguration(IConfiguration configuration, string sectionPath = "Engine")

configuration IConfiguration

The application configuration root.

sectionPath string

The configuration section path that contains the engine settings. The default is Engine.

HttpRequestResponseLoggingOptions

The bound request and response logging options.