MSALLoggerConfig

Objective-C

@interface MSALLoggerConfig : NSObject

Swift

class MSALLoggerConfig : NSObject

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

Note

Configuration changes inside MSALLoggerConfig will apply to all instances of MSALPublicClientApplication

Configuring log collection

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

    Declaration

    Objective-C

    @property MSALLogLevel logLevel;

    Swift

    var logLevel: MSALLogLevel { get set }
  • Deprecated

    Use logMaskingLevel 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 piiEnabled 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 (nonatomic) BOOL piiEnabled;

    Swift

    var piiEnabled: Bool { get set }
  • MSAL provides logging callbacks that assist in diagnostics. By default the library will not return any messages with any user or organizational information. However, this might make diagnosing issues difficult. logMaskingLevel property can be used to adjust level of MSAL masking. Default value is MSALLogMaskingSettingsMaskAllPII.

    Declaration

    Objective-C

    @property (nonatomic) MSALLogMaskingLevel logMaskingLevel;

    Swift

    var logMaskingLevel: MSALLogMaskingLevel { get set }

Setting up the logging callback

  • 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)setLogCallback:(nonnull MSALLogCallback)callback;

    Swift

    func setLogCallback(_ callback: @escaping MSALLogCallback)
  • Read current MSAL logging callback.

    Declaration

    Objective-C

    - (nonnull MSALLogCallback)callback;

    Swift

    func callback() -> MSALLogCallback

Unavailable initializers

  • Unavailable

    Use class properties instead.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    Use class properties instead.

    Declaration

    Objective-C

    + (nonnull instancetype)new;