.NET logging: Setup, configure and write a log with ILogger (uses .NET Core)

preview_player
Показать описание
To configure .NET logging, the ILogger interface can be used when building an ASP.NET Core application in C#.

With .NET Core, the Microsoft.Extensions.Logging NuGet package provides us with a number of extension methods that allows us to log at different levels.

With the ILogger interface, we can use a logging provider which logs to a particular format. There are a number of logging providers available including log4net and Serilog.

In-addition, we can also build a custom logging provider that allows us to build a .NET logging library and allows us to format a log in the way we want it written.

This video looks at writing a log, the different log levels and how to set the severity for an assembly, and how to configure writing logs for different custom providers. By watching the video, it will give you an idea on the best practices for logging, and will give you an idea on how to use it for your framework.

📖 Learn .NET and C# with our online courses 📖

► Chapters
0:00 Coming up...
0:06 ASP.NET Core logging overview
0:44 How logging works in ASP.NET Core
3:23 Logging providers
5:18 Why logging is important

#ilogger #aspnetcore #iloggerprovider
Рекомендации по теме
Комментарии
Автор

Great video!!! Im trying to add a field to the log, using the ILogger provider, any idea?

robertofernandezantunez
Автор

Great video... How do you go about logging in a hosted service? I know you did a recent video about hosted services, just wondering how you can pass the logger to the hosted service.

cesarrodriguez
Автор

Please! i can get source code project logging ?

ngoannguyen
Автор

it would be nice if you showed how to write log data to a file

Al-lwgy
Автор

Hmmm, log to console (instead of file) - strange example for Web application

kupchinsky
Автор

Aspnet .core logging suck no offense. its not straight forward when u want to log a file.

purplepanther