Logging is an integral part of .NET Core, which provides several abstractions to support it; needless to say, it is fully pluggable and extensible. The infrastructure classes, interfaces, abstract base classes, enumerations, and so on are contained in the Microsoft.Extensions.Logging.Abstractions NuGet package and the built-in implementations are contained in the Microsoft.Extensions.Logging package. When you log a message, it is routed to all registered logging providers.
Here, we will see the following:
- Using logging services
- Defining log levels
- Using logging providers
- Filtering logs
- Writing custom log providers
- Using dependency injection (DI) with the log providers
- Using logging attributes
We will study each of these in the coming sections.
Using logging services
We register the logging services by calling...