C#C
C#7mo ago
pasha

✅ How can I disable logging for a specific route in ASP.NET Core (.NET 6)?

I'm working on an ASP.NET Core Web API project using .NET 6, and I want to disable or suppress logging for a specific route (for example, /health). I’m using the built-in logging (ILogger) system.

Is there a recommended way to completely suppress logs (including request/response logs and middleware logs) for just one or two specific routes?

Thanks in advance!
Was this page helpful?