Part 79. Debug Logging Provider in ASP.NET Core MVC | Logging in aspnetcore |

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] foreign [Music] Concepts my name is Amit and this is part 79 of the asp.net core MVC tutorial in this video we will learn how to register logs to visual studio debug output window in asp.net core this is a continuation of part 78 event login asp.net core MVC so please watch it before proceeding to this one I shared the link in the description let's go to the visual studio and this is the project which we are working with you can see in our previous video we already registered logs via code to console and event log now if we have to register logs to debug we can add another log so type log Builder dot add debug here you can see we only have one Constructor for our debug so we cannot customize our logger from code and even this line is not mandatory here because debug logging provider is enabled by default so even if I remove this line it will work so if we cannot do anything here then what is its use so this line is useful in case I clear default providers at this starting like this so Builder Dot logging dot clear providers so my intention is that I don't want to use all the default providers initially now because this line clear all providers now I have to register it again all right next let's go to app settings.json or app settings.development.json in case you have set development environment and launch settings.json file so by default my debug log provider picked this default login here you can see default logging is set to trace let me run this application and let's check output window just in case you don't get output window just go to view and then output it will open the same window now you can see here we are getting log starting from Trace this output window is mainly for developers now as a developer what if I don't want to see all low severity level logs and I only want logs starting from warning in that case we can separately set log levels for debug as well let's stop the application go to appsettings.json file and type debug editor and then copy and paste log levels within curly braces let me change default log level from Trace to warning and that's it we are done let me run our application one more time and now if you look at the debug logs you can see we have log starting from severity level warning simple extremely simple so that's it from this short video hope you like our content if you have any queries related to the content of this video do ask me in the comments thanks for watching foreign [Music]
Info
Channel: PRO Concepts
Views: 151
Rating: undefined out of 5
Keywords: asp.net core logging tutorial, asp.net core mvc logging, asp.net core logging middleware, asp.net core logging providers, asp.net core logging example, asp.net mvc core tutorial, asp.net mvc core course, dot net core mvc tutorial, pro concepts, logging, debug logging, debug logging provider, logging provider, how to log in aspnet core, configure logging in aspnetcore, use debug logging in aspnetcore, debug logging in .net 6, debug logging provider in asp.net mvc
Id: 2vY2C-2kzHY
Channel Id: undefined
Length: 3min 53sec (233 seconds)
Published: Wed Sep 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.