Share via


LoggingOptions.ResponseBodyContentTypes Property

Definition

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

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

Property Value

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

Attributes

Examples

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

ResponseBodyContentTypesToLog = 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