LoggingOptions.ResponseBodyContentTypes Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for