Customizing ASP.NET Core, Part 1: Logging

In this first part of the new blog series about customizing ASP.NET Core, I will show you how to customize logging. The default logging only writes to the console or to the debug window. This is quite good for most cases, but you may need to log to a sink, like a file or a database. Maybe you want to extend the logger with additional information. In those cases, you need to know how to change the default logging.
The Series Topics

Customizing ASP.NET Core Part 01: Logging
Customizing ASP.NET Core Part 02: Configuration
Customizing ASP.NET Core Part 03: Dependency Injection
Customizing ASP.NET Core Part 04: HTTPS
Customizing ASP.NET Core Part 05: Hosted Services
Customizing ASP.NET Core Part 06: MiddleWares
Customizing ASP.NET Core Part 07: OutputFormatter
Customizing ASP.NET Core Part 08: ModelBinder
Customizing ASP.NET Core Part 09: ActionFilter
Customizing ASP.NET Core Part 10: TagHelpers

Configure Logging
In previous versions of ASP.NET Core (pre-2.0) the logging was configured in the Startup.cs. Since 2.0 the Startup.cs was simplified and a lot of configurations where moved to a default WebHostBuilder, which is called in the Program.cs. Also, the logging was moved to the default WebHostBuilder:

Link: https://dzone.com/articles/customizing-aspnet-core-part-1-logging?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev