December 2019
Intermediate to advanced
510 pages
11h 33m
English
So far, we have defined what to log in our application; in this section, we will illustrate how to do this. In ASP.NET Core, the logging provider is initialized using dependency injection. Moreover, it is possible to conditionally initialize it, depending on the environment or other startup options.
ASP.NET Core provides some built-in logging providers, as shown in the following table:
| Providers | Namespace | Description |
| Console | Microsoft.Extensions.Logging.Console |
Sets the console of the running application as the output of the logs.
|
| Debug | Microsoft.Extensions.Logging.Debug |
Writes messages in the debug output window when a debugger is attached.
|
| EventSource | Microsoft.Extensions.Logging.EventSource ... |
Read now
Unlock full access