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.
ILoggingFactory – Used to create ILogger type and to add ILogProvider instance. ASP.NET Core
runtime creates an instance of LoggerFactory class and registers it for ILoggerFactory when the application
starts, hence we can use ILoggerFactory interface anywhere in your application.
The IoC container will pass an instance of LoggerFactory.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.
ILoggingProvider – Used to create and manage loggers
ILogger – Includes methods to implement the actual logging to
various log destinations.
LoggingFactory – The class which implements ILoggingFactory. ASP.NET
Core framework includes built-in LoggerFactory class that implements
ILoggerFactory interface.
ASP.NET Core provides the following Logging Providers:
ASP.NET Core provides the following Logging Providers:
Console
Debug
EventSource
EventLog
TraceSource
Azure App Service
No comments:
Post a Comment