HttpLoggingFields Enum
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.
Flags used to control which parts of the request and response are logged.
This enumeration supports a bitwise combination of its member values.
[System.Flags]
public enum HttpLoggingFields
[<System.Flags>]
type HttpLoggingFields =
Public Enum HttpLoggingFields
- Inheritance
-
HttpLoggingFields
- Attributes
Fields
Name | Value | Description |
---|---|---|
None | 0 | No logging. |
RequestPath | 1 | Flag for logging the HTTP Request Path, which includes both the Path and PathBase. For example: Path: /index PathBase: /app |
RequestQuery | 2 | Flag for logging the HTTP Request QueryString. For example: Query: ?index=1 RequestQuery contents can contain private information which may have regulatory concerns under GDPR and other laws. RequestQuery should not be logged unless logs are secure and access controlled and the privacy impact assessed. |
RequestProtocol | 4 | Flag for logging the HTTP Request Protocol. For example: Protocol: HTTP/1.1 |
RequestMethod | 8 | Flag for logging the HTTP Request Method. For example: Method: GET |
RequestScheme | 16 | Flag for logging the HTTP Request Scheme. For example: Scheme: https |
RequestProperties | 29 | Flag for logging a collection of HTTP Request properties, including RequestPath, RequestProtocol, RequestMethod, and RequestScheme. |
ResponseStatusCode | 32 | Flag for logging the HTTP Response StatusCode. For example: StatusCode: 200 |
RequestHeaders | 64 | Flag for logging the HTTP Request Headers. Request Headers are logged as soon as the middleware is invoked. Headers are redacted by default with the character '[Redacted]' unless specified in the RequestHeaders. For example: Connection: keep-alive My-Custom-Request-Header: [Redacted] |
RequestPropertiesAndHeaders | 93 | Flag for logging HTTP Request properties and headers. Includes RequestProperties and RequestHeaders |
ResponseHeaders | 128 | Flag for logging the HTTP Response Headers. Response Headers are logged when the Body is written to or when StartAsync(CancellationToken) is called. Headers are redacted by default with the character '[Redacted]' unless specified in the ResponseHeaders. For example: Content-Length: 16 My-Custom-Response-Header: [Redacted] |
ResponsePropertiesAndHeaders | 160 | Flag for logging HTTP Response properties and headers. Includes ResponseStatusCode and ResponseHeaders. |
RequestTrailers | 256 | Flag for logging the HTTP Request Trailers. Request Trailers are currently not logged. |
ResponseTrailers | 512 | Flag for logging the HTTP Response Trailers. Response Trailers are currently not logged. |
RequestBody | 1024 | Flag for logging the HTTP Request Body. Logging the request body has performance implications, as it requires buffering the entire request body up to RequestBodyLogLimit. |
Request | 1117 | Flag for logging the entire HTTP Request. Includes RequestPropertiesAndHeaders and RequestBody. Logging the request body has performance implications, as it requires buffering the entire request body up to RequestBodyLogLimit. |
ResponseBody | 2048 | Flag for logging the HTTP Response Body. Logging the response body has performance implications, as it requires buffering the entire response body up to ResponseBodyLogLimit. |
Response | 2208 | Flag for logging the entire HTTP Response. Includes ResponsePropertiesAndHeaders and ResponseBody. Logging the response body has performance implications, as it requires buffering the entire response body up to ResponseBodyLogLimit. |
Duration | 4096 | Flag for logging how long it took to process the request and response in milliseconds. |
All | 7421 | Flag for logging both the HTTP Request and Response. Includes Request, Response, and Duration. Logging the request and response body has performance implications, as it requires buffering the entire request and response body up to the RequestBodyLogLimit and ResponseBodyLogLimit. |