Table of Contents

Delegate LogCallback

Namespace
Microsoft.Identity.Client
Assembly
Microsoft.Identity.Client.dll

Callback delegate that allows application developers to consume logs, and handle them in a custom manner. This callback is set using WithLogging(LogCallback, LogLevel?, bool?, bool?). If PiiLoggingEnabled is set to true, when registering the callback this method will receive the messages twice: once with the containsPii parameter equals false and the message without PII, and a second time with the containsPii parameter equals to true and the message might contain PII. In some cases (when the message does not contain PII), the message will be the same. For details see https://aka.ms/msal-net-logging

public delegate void LogCallback(LogLevel level, string message, bool containsPii)

Parameters

level LogLevel

Log level of the log message to process

message string

Pre-formatted log message

containsPii bool

Indicates if the log message contains Organizational Identifiable Information (OII) or Personally Identifiable Information (PII) nor not. If PiiLoggingEnabled is set to false then this value is always false. Otherwise it will be true when the message contains PII.

Constructors

LogCallback(object, nint)

public LogCallback(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(LogLevel, string, bool, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(LogLevel level, string message, bool containsPii, AsyncCallback callback, object @object)

Parameters

level LogLevel
message string
containsPii bool
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual void EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Invoke(LogLevel, string, bool)

public virtual void Invoke(LogLevel level, string message, bool containsPii)

Parameters

level LogLevel
message string
containsPii bool

See Also