Reducing log verbosity with Serilog RequestLogging: Using Serilog.AspNetCore...
One of the great aspects of ASP.NET Core is that logging is built-in to the framework. That means you can (if you want to) get access to all the deep infrastructural logs from your own standard logging...
View ArticleLogging the selected Endpoint Name with Serilog: Using Serilog.AspNetCore in...
In my previous post I described how to configure Serilog's RequestLogging middleware to create "summary" logs for each request, to replace the 10 or more logs you get from ASP.NET Core by default. In...
View ArticleLogging MVC properties with Serilog.AspNetCore: Using Serilog.AspNetCore in...
In my previous post I described how to configure Serilog's RequestLogging middleware to add additional properties (such as the request hostname or the selected endpoint name) to Serilog's request log...
View ArticleExcluding health check endpoints from Serilog request logging: Using...
In previous posts in this series I have described how to configure Serilog's RequestLogging middleware to add additional properties to Serilog's request log summary such as the request hostname or the...
View ArticleInserting middleware between UseRouting() and UseEndpoints() as a library...
This post is in response to a question from a reader about how library authors can ensure consumers of their library insert the library's middleware at the right point in the app's middleware pipeline....
View ArticleInserting middleware between UseRouting() and UseEndpoints() as a library...
This post follows on from my previous post - if you haven't already, I strongly recommend reading that one first. These posts are in response to a question from a reader about how library authors can...
View ArticleCreating an endpoint from multiple middleware in ASP.NET Core 3.x
In a recent post I discussed the changes to routing that come in ASP.NET Core 3.0, and how you can convert a "terminal" middleware to the new "endpoint" design. One question I've received is whether...
View ArticleExploring the new rollForward and allowPrerelease settings in global.json:...
I was listening to the Azure DevOps Podcast with Jeffrey Palermero recently and heard Kathleen Dollard mention that there were some updates to the global.json file and .NET Core SDK in 3.0. This post...
View ArticleWhen ASP.NET Core can't find your controller: debugging application parts
In this post I describe application parts and how ASP.NET Core uses them to find the controllers in your app. I then show how you can retrieve the list at runtime for debugging purposes. Debugging a...
View ArticleCreating a custom ErrorHandlerMiddleware function
In this post I show how to customise the ExceptionHandlerMiddleware to create custom responses when an error occurs in your middleware pipeline, instead of providing a path to "re-execute" the...
View ArticleHow to fix the order of commits in GitHub Pull Requests
In this post I show how to ensure your commits in a GitHub pull request (PR) are in the order you expect for reviewers - i.e. the logical order of the commits to a branch, not the date order. Warning:...
View ArticleConverting a .NET Standard 2.0 library to .NET Core 3.0: Upgrading to ASP.NET...
This is the first post in a new series on upgrading from ASP.NET Core 2.x to ASP.NET Core 3.0. I'm not going to cover big topics like adding Blazor or gRPC to your apps. Instead I'm going to cover the...
View ArticleIHostingEnvironment vs IHostEnvironment - obsolete types in .NET Core 3.0:...
In this post I describe the differences between various ASP.NET Core types that have been marked as obsolete in .NET Core 3.0. I describe why things have changed, where the replacement types are, and...
View ArticleAvoiding Startup service injection in ASP.NET Core 3: Upgrading to ASP.NET...
In this post I describe one of the changes to Startup when moving from an ASP.NET Core 2.x app to .NET Core 3; you can not longer inject arbitrary services into the Startup constructor. Migrating to...
View ArticleWhen ASP.NET Core can't find your controller: debugging application parts
In this post I describe application parts and how ASP.NET Core uses them to find the controllers in your app. I then show how you can retrieve the list at runtime for debugging purposes. Debugging a...
View ArticleCreating a custom ErrorHandlerMiddleware function
In this post I show how to customise the ExceptionHandlerMiddleware to create custom responses when an error occurs in your middleware pipeline, instead of providing a path to "re-execute" the...
View ArticleHow to fix the order of commits in GitHub Pull Requests
In this post I show how to ensure your commits in a GitHub pull request (PR) are in the order you expect for reviewers - i.e. the logical order of the commits to a branch, not the date order. Warning:...
View ArticleDon't replace your View Components with Razor Components
In this post I take a brief look at Razor Components, and whether you should consider using them instead of View Components. I'm sure you can guess my conclusion from the title, but I admit that's...
View ArticleReplacing AJAX calls in Razor Pages with Razor Components and Blazor
In a recent post I looked at whether you should consider using Razor Components in places where you would previously have used View Components. The answer was an emphatic no, but that doesn't mean you...
View ArticleAccessing route values in endpoint middleware in ASP.NET Core 3.0
In my recent series about upgrading to ASP.NET Core 3.0, I described how the new endpoint routing system can be combined with terminal middleware (i.e. middleware that generates a response). In that...
View Article