Share via


LoggingOptions.RequestBodyContentTypes Property

Definition

Gets or sets the set of request body content types which are considered text and thus possible to log.

[System.ComponentModel.DataAnnotations.Required]
public System.Collections.Generic.ISet<string> RequestBodyContentTypes { get; set; }
[<System.ComponentModel.DataAnnotations.Required>]
member this.RequestBodyContentTypes : System.Collections.Generic.ISet<string> with get, set
Public Property RequestBodyContentTypes As ISet(Of String)

Property Value

The default value is an empty HashSet<T>, which means that the request's body isn't logged.

Attributes

Examples

A typical set of known text content-types like json, xml or text would be:

RequestBodyContentTypesToLog = new HashSet<string>
{
    "application/*+json",
    "application/*+xml",
    "application/json",
    "application/xml",
    "text/*"
};

Remarks

Don't enable body logging in a production environment, as it might impact performance and leak sensitive data. If you need to log body in production, go through compliance and security.

Applies to