Serilog (edit)
@devlead Console Template
dotnet new --install Devlead.Console.Template
References
- Devlead.Console.Template (NuGet)
- Spectre.Console (NuGet)
- Spectre.Cli.Extensions.DependencyInjection (NuGet)
- Dependency injection in ASP.NET Core (NuGet)
- Source Link (NuGet)
- Logging in .NET Core and ASP.NET Core (NuGet)
Application log files play an important role in analyzing the bugs and for troubleshooting issues in an application. It’s worth noting that the log files are also used for writing information about events and other information that occurs when the application is running or serving requests in the case of a web application. Most application developers use a single file to log everything from errors, warnings, debug information, etc. There is no harm in following this approach, but the downside is that it will be harder for you to segregate information from the file easily. We can easily overcome this by maintaining multiple log files depending on the need. In this post, I am going to show how we can achieve this with Serilog.
Serilog is a popular third party diagnostic logging library for .NET applications, I have already written some post about it and it’s usage already. If you are new to Serilog, please refer to those posts using the links given below.
- Implementing Logging in a .NET Core Web Application using Serilog
- Rollover log files automatically in an ASP.NET Core Web Application using Serilog
- Write your logs into database in an ASP.NET Core application using Serilog
- Adding Serilog to Azure Functions created using .NET 5
- Learn how to split log data into different tables using Serilog in ASP.NET Core
- Writing logs to different files using Serilog in ASP.NET Core Web Application
- Write your logs into database in an ASP.NET Core application using Serilog
- Rollover log files automatically in an ASP.NET Core Web Application using Serilog
Console Application Template
Console Application Entity Framework Core
Getting Started With Entity Framework Core - Console | Learn Entity Framework Core