File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
sdk/ai/azure-ai-projects/azure/ai/projects Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 33
33
)
34
34
if _console_logging_enabled :
35
35
import sys
36
-
36
+ # Enable detailed console logs across Azure libraries
37
37
azure_logger = logging .getLogger ("azure" )
38
38
azure_logger .setLevel (logging .DEBUG )
39
39
azure_logger .addHandler (logging .StreamHandler (stream = sys .stdout ))
40
+ # Exclude detailed logs for network calls associated with getting Entra ID token.
40
41
identity_logger = logging .getLogger ("azure.identity" )
41
42
identity_logger .setLevel (logging .ERROR )
43
+ # Make sure regular (redacted) detailed azure.core logs are not shown, as we are about to
44
+ # turn on non-redacted logs by passing 'logging_enable=True' to the client constructor
45
+ # (which are implemented as a separate logging policy)
46
+ logger = logging .getLogger ("azure.core.pipeline.policies.http_logging_policy" )
47
+ logger .setLevel (logging .ERROR )
42
48
43
49
44
50
def _patch_user_agent (user_agent : Optional [str ]) -> str :
Original file line number Diff line number Diff line change 34
34
)
35
35
if _console_logging_enabled :
36
36
import sys
37
-
37
+ # Enable detailed console logs across Azure libraries
38
38
azure_logger = logging .getLogger ("azure" )
39
39
azure_logger .setLevel (logging .DEBUG )
40
40
azure_logger .addHandler (logging .StreamHandler (stream = sys .stdout ))
41
+ # Exclude detailed logs for network calls associated with getting Entra ID token.
41
42
identity_logger = logging .getLogger ("azure.identity" )
42
43
identity_logger .setLevel (logging .ERROR )
44
+ # Make sure regular (redacted) detailed azure.core logs are not shown, as we are about to
45
+ # turn on non-redacted logs by passing 'logging_enable=True' to the client constructor
46
+ # (which are implemented as a separate logging policy)
47
+ logger = logging .getLogger ("azure.core.pipeline.policies.http_logging_policy" )
48
+ logger .setLevel (logging .ERROR )
43
49
44
50
45
51
class AIProjectClient (AIProjectClientGenerated ): # pylint: disable=too-many-instance-attributes
You can’t perform that action at this time.
0 commit comments