ASP.NET Core Fundamentals (Part 2)
In Chapter 3, we learned about three important components in ASP.NET Core: routing, configuration, and environment. Next, let’s continue to explore the other components in ASP.NET Core.
In this chapter, we will cover the following topics:
- Logging
- Middleware
ASP.NET Core provides a flexible logging API that works with many logging providers. We can send and store the logs in various destinations, such as the console, text files, Azure Application Insights, and so on. When the application has issues, logs can help us find out what is going on. Logging belongs to a bigger topic called observability, which is a set of practices that help us understand the state of the application. In this chapter, we will learn how to use the logging API in ASP.NET Core.
Middleware is a component that can be plugged into the request pipeline to handle requests and responses. It is one of the most important improvements in ASP.NET Core compared...