| Asp.Net Core Logging Overview
|
Showing posts with label Logging. Show all posts
Showing posts with label Logging. Show all posts
Monday, April 6, 2020
Asp.Net Core Console logging
In the previous post we
saw the various Interfaces and Classes provided by Asp.Net Core to support logging, in this post we shall see on how
to enable Console logging in an Asp.Net
Core Web API application.
To enable a specific type of log we need to add the log provider to the startup. To add a provider we need to call the provider's Add extension method under ConfigureLogging in Program.cs. To Add a console log provider we need to add the following to the Program.cs
To enable a specific type of log we need to add the log provider to the startup. To add a provider we need to call the provider's Add extension method under ConfigureLogging in Program.cs. To Add a console log provider we need to add the following to the Program.cs
Asp.Net Core Logging
Logging is a crucial part of any application, especially for large
applications logging is very important in production environment where
debugging is not straight forward. The Asp.Net Core framework provides built-in
support for logging.
In Asp.Net Core logging support is provided by the Microsoft.Extensions.Logging namespace. This namespace provides the following classes and interfaces to support Logging.
In Asp.Net Core logging support is provided by the Microsoft.Extensions.Logging namespace. This namespace provides the following classes and interfaces to support Logging.
Labels:
Asp.Net Core,
ILogger,
ILoggingFactory,
ILogProvider,
Logging
Subscribe to:
Posts (Atom)