Sometimes you just need some logging to do a sanity check that things are actually working the way that you’re expecting.
Here’s how to turn logging on in ASP.NET Core 2 for SignalR:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Startup>() | |
.ConfigureLogging(logging => | |
{ | |
// Set the logging level for SignalR: | |
logging.AddFilter("Microsoft.AspNetCore.SignalR", LogLevel.Debug); | |
// Set the logging level for Http Connections: | |
logging.AddFilter("Microsoft.AspNetCore.Http.Connections", LogLevel.Debug); | |
}) | |
.Build(); |
I’ve had to look this up more than twice, and its not exactly easy to find in the Microsoft docs, so I’m just writing it down here so I can find it quickly again.
Logging in a .NET Core 3 SignalR client – Darchuk.NET
[…] in a previous post I talked about turning on SignalR logging at the server to see if something goofy is happening, but what if you wanted to turn on logging on […]