Logging - AzureAD/microsoft-authentication-extensions-for-dotnet GitHub Wiki

This library uses TraceSource logging.

Capturing logs with Visual Studio

If you open the Debug window from Visual Studio, it will display all the log entries from the library, unfiltered by severity.

Capturing logs from a production app

The simplest is to install https://docs.microsoft.com/en-gb/sysinternals/downloads/debugview. When library is running, Warning and Error messages will be captured here. To log all messages, set an environment variable named IDENTITYEXTENSIONTRACELEVEL to All and restart the app.

Advanced logging

The library logs using a TraceSource named Microsoft.Identity.Client.Extensions.TraceSource and level set to Warning in Release builds. You can configure various log listeners as per https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/how-to-create-and-initialize-trace-listeners.