Home Simple way to log all failed route requests in .NET core byAlex R. •June 28, 2021 Add this simple middleware:app.Use(async (context, next) => { await next(); if (context.Response.StatusCode == 404) { /* Log the context data */ } }); Facebook Twitter