-
Notifications
You must be signed in to change notification settings - Fork 94
Logging
Historically ADAL Python (up to 1.2.1) will emit some logs at INFO level. If you happen to also configure your Python script's root logger with INFO level, you will then see many ADAL Python internal logs, which may not be what you want.
In Python, the standard way to disable logs in an underlying library,
is to explicitly configure their logger to a higher
level.
And, since ADAL Python uses a logger named adal-python
,
you can easily disable it by adding this at the early part of your Python script:
import logging
logging.getLogger("adal-python").setLevel(logging.WARN) # Disable INFO and DEBUG
Starting from ADAL Python 0.5.1, by default, ADAL logging does not capture or log any PII or OII. The library allows app developers to turn this on by configuring the enable_pii
flag on the AuthenticationContext. By turning on PII or OII, the app takes responsibility for safely handling highly-sensitive data and complying with any regulatory requirements.
//PII or OII logging disabled. Default Logger does not capture any PII or OII.
auth_context = AuthenticationContext(...)
//PII or OII logging enabled
auth_context = AuthenticationContext(..., enable_pii=True)