Logging can help us to diagnose failures and know what is happening in the system in real time. We can enable detailed logging for SignalR in either configuration or through code. For the first option, add the last two lines to your appsettings.json file (for "Microsoft.AspNetCore.SignalR" and"Microsoft.AspNetCore.Http.Connections"):
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information",
"Microsoft.AspNetCore.SignalR": "Trace",
"Microsoft.AspNetCore.Http.Connections": "Trace"
}
}
}
To the latter, add the configuration to the bootstrap code:
publicstatic IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(builder =>
{
builder
.ConfigureLogging(logging =...