I have a Blazor WebAssembly application created directly from template, and I have added logging procedures as described in Blazor WebAssembly Logging
I have added the line builder.Logging.SetMinimumLevel in my class Program, method Main
public class Program
{
const string serverHttpClientName = "GoodSales.ServerAccessApi";
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
IConfiguration configuration = builder.Configuration;
// JMA: Configure logging
builder.Logging.SetMinimumLevel(LogLevel.Debug);
NOTICE: I have no added specific logger, because navigator console log is enough for me.
Then, I have added logging in my razor component
@using Microsoft.AspNetCore.SignalR.Client
@using GoodSales.Services
@inject NavigationManager NavigationManager
@using Microsoft.Extensions.Logging;
@inject ILogger<NavMenu> logger;
@inject ILoggerProvider LoggerProvider
And added testing line in the initialization method
protected override async Task OnInitializedAsync()
{
logger.LogDebug("LogDebug test");
logger.LogInformation("LogInformation test");
logger.LogWarning("LogWarning test");
But, in the navigator console I only see the LogInformation and the LogWarning, but not the LogDebug.
What am I missing?
