MSALLogger

Objective-C

@interface MSALLogger : NSObject

Swift

class MSALLogger : NSObject

MSAL configuration interface responsible for setting up MSAL logging callback and configuring log collection behavior.

Note

MSALLogger is deprecated. Configure MSAL logging inside MSALLoggerConfig instead

Unavailable initializers

  • Unavailable

    Configure MSAL logging inside MSALLoggerConfig instead

    Declaration

    Objective-C

    - (nonnull instancetype)init;

Getting a shared logger configuration

  • Deprecated

    use MSALGlobalConfig.loggerConfig instead

    Returns a shared logger configuration.

    Declaration

    Objective-C

    + (nonnull MSALLogger *)sharedLogger;

    Swift

    class func shared() -> MSALLogger

Configuring log collection

  • Deprecated

    use MSALGlobalConfig.loggerConfig.logLevel instead

    The minimum log level for messages to be passed onto the log callback.

    Declaration

    Objective-C

    @property MSALLogLevel level;

    Swift

    var level: MSALLogLevel { get set }
  • Deprecated

    use MSALGlobalConfig.loggerConfig.piiEnabled instead

    MSAL provides logging callbacks that assist in diagnostics. There is a boolean value in the logging callback that indicates whether the message contains user information. If PiiLoggingEnabled is set to NO, the callback will not be triggered for log messages that contain any user information. By default the library will not return any messages with user information in them.

    Declaration

    Objective-C

    @property BOOL PiiLoggingEnabled;

    Swift

    var piiLoggingEnabled: Bool { get set }

Setting up the logging callback

  • Deprecated

    use MSALGlobalConfig.loggerConfig setLogCallback: instead

    Sets the callback block to send MSAL log messages to.

    Note

    Once this is set this can not be unset, and it should be set early in the program’s execution.

    Note

    MSAL logs might contain potentially sensitive information. When implementing MSAL logging, you should never output MSAL logs with NSLog or print directly, unless you’re running your application in the debug mode. If you’re writing MSAL logs to file, you must take necessary precautions to store the file securely.

    Additionally, MSAL makes determination regarding PII status of a particular parameter based on the parameter type. It wouldn’t automatically detect a case where PII information is passed into non-PII parameter due to a developer mistake (e.g. MSAL doesn’t consider clientId PII and it expects developers to exersice caution and never pass any unexpected sensitive information into that parameter).

    Declaration

    Objective-C

    - (void)setCallback:(nonnull MSALLogCallback)callback;

    Swift

    func setCallback(_ callback: @escaping MSALLogCallback)