HttpLoggingPolicy Class

The Pipeline policy that handles logging of HTTP requests and responses.

Inheritance
azure.core.pipeline.policies._base.SansIOHTTPPolicy
HttpLoggingPolicy

Constructor

HttpLoggingPolicy(logger=None, **kwargs)

Parameters

logger
default value: None

Methods

on_request

Logs HTTP method, url and headers. :param request: The PipelineRequest object. :type request: ~azure.core.pipeline.PipelineRequest

on_response

Is executed after the request comes back from the policy.

on_request

Logs HTTP method, url and headers. :param request: The PipelineRequest object. :type request: ~azure.core.pipeline.PipelineRequest

on_request(request: azure.core.pipeline.PipelineRequest) -> None

Parameters

request
Required

on_response

Is executed after the request comes back from the policy.

on_response(request: azure.core.pipeline.PipelineRequest, response: azure.core.pipeline.PipelineResponse) -> None

Parameters

request
PipelineRequest
Required

Request to be modified after returning from the policy.

response
PipelineResponse
Required

Pipeline response object

Attributes

DEFAULT_HEADERS_WHITELIST

DEFAULT_HEADERS_WHITELIST = {'Accept', 'Cache-Control', 'Connection', 'Content-Length', 'Content-Type', 'Date', 'ETag', 'Expires', 'If-Match', 'If-Modified-Since', 'If-None-Match', 'If-Unmodified-Since', 'Last-Modified', 'Pragma', 'Request-Id', 'Retry-After', 'Server', 'Transfer-Encoding', 'User-Agent', 'WWW-Authenticate', 'traceparent', 'x-ms-client-request-id', 'x-ms-request-id', 'x-ms-return-client-request-id'}

MULTI_RECORD_LOG

MULTI_RECORD_LOG = 'AZURE_SDK_LOGGING_MULTIRECORD'

REDACTED_PLACEHOLDER

REDACTED_PLACEHOLDER = 'REDACTED'