diff --git a/aspnetcore/blazor/fundamentals/logging.md b/aspnetcore/blazor/fundamentals/logging.md index efdcf0da06..629eee9d36 100644 --- a/aspnetcore/blazor/fundamentals/logging.md +++ b/aspnetcore/blazor/fundamentals/logging.md @@ -1749,35 +1749,20 @@ var connection = new HubConnectionBuilder() *This section only applies to Blazor WebAssembly apps.* -Log messages specific to for the or logging levels using ***either*** the following approaches: +Log Blazor authentication messages at the or logging levels with a log filter for in `Program.cs`. -* Add a log filter for in `Program.cs`: +The following example: - ```csharp - #if DEBUG - builder.Logging.AddFilter( - "Microsoft.AspNetCore.Components.WebAssembly.Authentication", - LogLevel.Debug); - #endif - ``` +* 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. -* Provide an app settings file for the `Development` environment (`wwwroot/appsettings.Development.json`) with log level configuration: - - ```json - { - "DetailedErrors": true, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "Microsoft.AspNetCore.Components.WebAssembly.Authentication": "Debug" - } - } - } - ``` - - Set the value to either "`Debug`" or "`Trace`". +```csharp +#if DEBUG + builder.Logging.AddFilter( + "Microsoft.AspNetCore.Components.WebAssembly.Authentication", + LogLevel.Debug); +#endif +``` > [!NOTE] > Blazor WebAssembly apps only log to the client-side [browser developer tools](https://developer.mozilla.org/docs/Glossary/Developer_Tools) console.