Skip to content

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Nov 4, 2020

Description

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 4, 2020

Core

@yonzhan yonzhan added this to the S178 milestone Nov 4, 2020
Comment on lines +123 to +125
# Disable ARMHttpLoggingPolicy which logs only allowed headers
from azure.core.pipeline.policies import SansIOHTTPPolicy
client_kwargs['http_logging_policy'] = SansIOHTTPPolicy()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qwordy, This will remove the duplicated network trace.

azure.core.pipeline.policies._universal : Request URL: 'https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590?api-version=2016-06-01'
azure.core.pipeline.policies._universal : Request method: 'GET'
azure.core.pipeline.policies._universal : Request headers:
azure.core.pipeline.policies._universal :     'Accept': 'application/json'
...
azure.core.pipeline.policies.http_logging_policy : Request URL: 'https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590?api-version=REDACTED'
azure.core.pipeline.policies.http_logging_policy : Request method: 'GET'
azure.core.pipeline.policies.http_logging_policy : Request headers:
azure.core.pipeline.policies.http_logging_policy :     'Accept': 'application/json'
...
azure.core.pipeline.policies.http_logging_policy : Response status: 200
azure.core.pipeline.policies.http_logging_policy : Response headers:
azure.core.pipeline.policies.http_logging_policy :     'Cache-Control': 'no-cache'
...
azure.core.pipeline.policies._universal : Response status: 200
azure.core.pipeline.policies._universal : Response headers:
azure.core.pipeline.policies._universal :     'Cache-Control': 'no-cache'
...

Logs from azure.core.pipeline.policies.http_logging_policy will now be disabled.

@jiasli jiasli requested a review from qwordy November 4, 2020 06:38
@qwordy
Copy link
Member

qwordy commented Nov 4, 2020

Can we add a timestamp for each log?

@jiasli
Copy link
Member Author

jiasli commented Nov 4, 2020

Can we add a timestamp for each log?

This is very tricky because python's logging doesn't support UTC formatting with microseconds. We need to write our own customized logger for this. This will be addressed in the future in a separate PR.

@jiasli jiasli merged commit 86463c1 into Azure:dev Nov 11, 2020
@jiasli jiasli deleted the refactor-track2 branch November 11, 2020 08:04
@jiasli jiasli added the Track2 label Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants