From the course: ASP.NET Core: Health Checks and Logging

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understanding ILogger<T>

Understanding ILogger<T> - ASP.NET Core Tutorial

From the course: ASP.NET Core: Health Checks and Logging

Start my 1-month free trial

Understanding ILogger<T>

- [Instructor] Let's talk about ASP.NET Core Logging. So we will create log entries, create a log, see different ways of doing that different ways to find a storage for those logs and a few extra features features. Most of them are based on one specific interface, the ILogger Interface. It's a generic interface and if you say, go to the studio or the studio code create a new class which is using that interface, and then ask the IDE to pre-populate your class with the methods you need to implement because they are part of the interface. You'll get three things. First of all, you will get a method called BeginScope which can be used to logically group certain log entries We'll see that in a bit. There's a property IsEnabled or well, and then there is one method called Log which can expect a lot of different properties and basically that's it. So you have an interface that requires us to implement a method…

Contents