In this video we will discuss Logging in ASP.NET Core.
Logging providers in ASP.NET Core
Text version of the video
https://csharp-video-tutorials.blogsp...
Slides
https://csharp-video-tutorials.blogsp...
ASP.NET Core Text Articles & Slides
https://csharp-video-tutorials.blogsp...
ASP.NET Core Tutorial
https://www.youtube.com/playlist?list...
Angular, JavaScript, jQuery, Dot Net & SQL Playlists
https://www.youtube.com/user/kudvenka...
A logging provider is the component that stores or displays logs. For example, the Console log provider displays logs on the console. Similarly, the Debug log provider displays logs on the Debug window in Visual Studio.
ASP.NET Core built-in logging providers
Console
Debug
EventSource
EventLog
TraceSource
AzureAppServicesFile
AzureAppServicesBlob
ApplicationInsights
Third party logging providers for ASP.NET Core
NLog
elmah
Serilog
Sentry
Gelf
JSNLog
KissLog.net
Loggr
Stackdriver
Default logging providers in ASP.NET Core
Main() method in the Program class in Program.cs file is the entry point for an asp.net core application. This method calls CreateDefaultBuilder() method performs several tasks like
Setting up the web server
Loading the host and application configuration from various configuration sources and
Configuring logging
Since ASP.NET Core is open source we can see the complete source on their official github page. The following is the code snippet from CreateDefaultBuilder() method.
.ConfigureLogging((hostingContext, logging) =]
{ logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); logging.AddConsole(); logging.AddDebug(); logging.AddEventSourceLogger();
})
As part of configuring logging, CreateDefaultBuilder() method adds the following 3 logging providers by default. This is the reason when we run the asp.net core project we see the log displayed both on the console and on the debug window in Visual Studio.
Console
Debug
EventSource
CreateDefaultBuilder() method looks for Logging section in the application configuration file appsettings.json.
Logging section in appsettings.json
The following is the Logging section in appsettings.json file on my machine.
"Logging": {
"LogLevel": { "Default": "Warning", "Microsoft": "Information"
}
}
LogLevel is used to control how much log data is logged or displayed. We will discuss Log level in detail in our upcoming videos.
asp.net core docker Logging in ASP NET Core | |
| 163 Likes | 163 Dislikes |
| 15,453 views views | 524K followers |
| Science & Technology | Upload TimePublished on 28 May 2019 |
Related keywords
ajax meaning,csharp-video-tutorials.blogspot,central park 5,csharp string format,asp.net core github,craigslist nj,asp.net core 3,server status,ajax fc,ajax players,server jobs nyc,asp.net core swagger,credit karma,csharp corner,asp.net machine account,server error in '/' application,servers for minecraft,asp.net core dependency injection,asp.net core 3.0,calculator,ajax ontario,asp.net mvc tutorial,asp.net core 3 release date,server job description,asp.net cos'è,csharp assembly,csharp array,asp.net core web api,ajax jquery,craigslist ny,csharp enum,ajax call,asp.net core 2. guida completa per lo sviluppatore,asp.net core,server pro,server status ffxiv,asp.net zero,cheap flights,csharp foreach,server memes,asp.net core hosting,chase,serverless architecture,server resume,server books,csharp to json,college football,ajax deadpool,csharp dictionary,server jobs,cvs,cnn,costco hours,asp.net web api,server side rendering,serverless,asp.net core download,csharp to vb.net,cool math games,citibank,asp.net core identity,ajax parking,asp.net core logging,cunyfirst,ajax post,asp.net guida,csharp download,csharp online,ajax jersey,csharp operator,asp.net core razor pages,server duties,asp.net core environment variables,csharp random,http://asp.net,server 2019,chernobyl,century 21,serverminer,ajax cleaner,asp.net core configuration,csharp list,ajax marvel,asp.net tutorial,asp.net mvc,asp.net core tutorial,ajax roster,asp.net core mvc,ajax soccer,chase online,server hosting,costco,server jobs near me,ajax dish soap,capital one,server rack,csharp interface,craigslist,ajax tavern,ajax javascript,ajax request,asp.net core 2.2,asp.net core signalr,ajax paving,ajax greek,csharp tutorial,asp.net identity,asp.net core middleware,csharp online compiler,asp.net download,csharp switch,csharpstar,
Không có nhận xét nào:
Đăng nhận xét