Logging in .NET Core

Logging is a built-in module in .NET Core. Logging can simply be enabled by requesting the ILoggerFactory or ILogger<T> through dependency injection. When using ILoggerFactory, the category name has to be defined, whereas, with ILogger<T>, the class type name will be used as the category name.

The default provider is AddConsole, which logs the message on the console application. However, new providers can also be implemented and added by calling the AddProvider method of ILoggerFactory.

This screenshot shows the final structure of the business layer:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.21