From 9ae975f160f12ba859a32bf9aea25c0e4d8420f9 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:19:06 -0500 Subject: [PATCH] Blazor WASM auth logging updates --- aspnetcore/blazor/fundamentals/logging.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/fundamentals/logging.md b/aspnetcore/blazor/fundamentals/logging.md index e867d1f9cd9e..c3ff2fd2367f 100644 --- a/aspnetcore/blazor/fundamentals/logging.md +++ b/aspnetcore/blazor/fundamentals/logging.md @@ -1749,9 +1749,21 @@ var connection = new HubConnectionBuilder() *This section only applies to Blazor WebAssembly apps.* -Log Blazor authentication messages at the or logging levels with a log filter for in `Program.cs`. +Log Blazor authentication messages at the or logging levels with a logging configuration in app settings or by using a log filter for in `Program.cs`. -The following example: +In an app settings file (for example, `wwwroot/appsettings.Developoment.json`): + +```json +"Logging": { + "LogLevel": { + "Microsoft.AspNetCore.Components.WebAssembly.Authentication": "Debug" + } +} +``` + +For more information on how to enable a Blazor WebAssembly app to read app settings files, see . + +Using a log filter, the following example: * Activates logging for the `Debug` build configuration using a [C# preprocessor directive](/dotnet/csharp/language-reference/preprocessor-directives). * Logs Blazor authentication messages at the log level.