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 HttpRequestResponseLoggingOptionsInheritance
Section titled “Inheritance”object ← HttpRequestResponseLoggingOptions
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”HttpRequestResponseLoggingOptions()
Section titled “ HttpRequestResponseLoggingOptions()”Creates request and response logging options with body capture disabled by default.
public HttpRequestResponseLoggingOptions()Properties
Section titled “Properties”Enabled
Section titled “ Enabled”Gets or sets a value indicating whether the ASP.NET Core host should log request and response summaries.
public bool Enabled { get; set; }Property Value
Section titled “Property Value”LogRequestBody
Section titled “ LogRequestBody”Gets or sets a value indicating whether textual request bodies should be logged.
public bool LogRequestBody { get; set; }Property Value
Section titled “Property Value”LogResponseBody
Section titled “ LogResponseBody”Gets or sets a value indicating whether textual response bodies should be logged.
public bool LogResponseBody { get; set; }Property Value
Section titled “Property Value”RedactSensitiveValues
Section titled “ RedactSensitiveValues”Gets or sets a value indicating whether known-sensitive query-string and payload fields should be redacted before logging.
public bool RedactSensitiveValues { get; set; }Property Value
Section titled “Property Value”RedactedFieldNames
Section titled “ RedactedFieldNames”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; }Property Value
Section titled “Property Value”RedactionValue
Section titled “ RedactionValue”Gets or sets the placeholder written to logs when a sensitive value is redacted.
public string RedactionValue { get; set; }Property Value
Section titled “Property Value”RequestBodyLimit
Section titled “ RequestBodyLimit”Gets or sets the maximum number of request-body characters to log before the payload is truncated.
public int RequestBodyLimit { get; set; }Property Value
Section titled “Property Value”ResponseBodyLimit
Section titled “ ResponseBodyLimit”Gets or sets the maximum number of response-body characters to log before the payload is truncated.
public int ResponseBodyLimit { get; set; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”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")Parameters
Section titled “Parameters”configuration IConfiguration
The application configuration root.
sectionPath string
The configuration section path that contains the engine settings. The default is Engine.
Returns
Section titled “Returns”HttpRequestResponseLoggingOptions
The bound request and response logging options.