Logging in .NET Core 3.0 and Beyond - Configuration, Setup, and More

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you've ever done work with dotnet core you have probably seen the ilogger interface maybe you even know that dotnet core has logging built-in by default but how do you use it how do you configure it can you replace it is that a big deal these are some of the questions that this video will tackle we're gonna look at what is provided out of the box from for dotnet core projects and how to use it effectively a source code for today's video is available at download using the link below in the description you'll also find links there a sign up for my mailing list and for my patreon as you watch this video please post your thoughts and questions in the comments below I'll do my best to respond to you now if you haven't come across before my name is Tim quarry and it's my goal to make learning c-sharp easier one of the ways I do that is by teaching context there are a lot of tutorials out there that will teach you what to do I go a few steps beyond that to show you when to do it why you should do it or should not do it what the pitfalls are to avoid and what the best practices are basically I get you ready for the real world if that's a type of training you're interested in subscribe to my channel and hit the little bell icon to be notified when I release new videos okay let's get started we're going to create a new project now I'm using Visual Studio 2019 the preview version which has the latest bit sent and this case I'm going to select an asp.net core web application I call this logging demo and logging demo app the solution named it create a choice of what to a project create now this is one case where you may deviate a little bit from me when you create your demo application so if you're following along if you don't have the preview version of Visual Studio you probably don't have asp.net core 3.0 I'm gonna select 300 because there are a couple of tweaks in how logging works how depends injection works in dotnet core 3.0 that will change how we do a couple of things and so I'll try to point those out but most of this project will work exactly the same if you're in dotnet core 2.2 so if you want to choose to get to that's fine or even 2.1 but I am choosing the the dotnet core 3.0 which isn't quite ready for production it's almost it's getting released I believe in September and this is pretty much the stable version right now for dotnet core 3 surest select web application over here on the right I'm not gonna choose authentication I am gonna configure HTTPS just because that should be a default and I will not use docker support notice down here my dotnet core version is the dotnet 3 preview 8 version let create and once that creates we'll get a basic web application for razor pages and if we open up our solution explorer here we can see that we have a few pages and shared we have a couple pitch shared we have a few down here including index dot CSS HTML if you open up index dot CSS HTML will notice this eye logger here and that's we're gonna cover today what is that I logger where does it come from how does it get configured and how do we use it so the first place to look in dotnet core whenever you have a configuration thing like this there's two places one look and start up but see does anything configured and start up and in this case I'll give you a hint there's not there's nothing to start up for logging here and then it can go to program CS which is the entry point for our application to see if is aiming configured here for logging now if you notice the green squiggly is just so you know the reason why is because they want me to switch over to the block body methods to this lambda expression which I'm actually going to do so let's say use block body method instead of the lambda and I'll cook fear that look a little nicer so right here is where logging gets configured and if you can't see it I understand that it's right here under create default builder that logging gets configured and how do I know that well if I hit f12 to get a definition here for create default builder and expand out this this comment here it tells me all the things that default builder does which is very helpful because we don't see int normally as let me do some looking at Microsoft source code but in general this just gives us a good overview of what's happening inside this default builder and if we look right down here configure the Microsoft extensions dot logging dot ilogger factory to log to the console debug and event source outputs so that's the default configuration for logging now what does that mean we'll get in that a minute but just know that that's where logging by default happens now also in here is enable scope validation on a pendency injection container when the host is in development and there's some other things in here that may be of interest to you so as other things that this does but one thing that does that configures default logging and it logs to debug console and the event source so let's do this let's just show off what happens out of the box with nothing being touched no configuration changes I'm at launch this as logging demo not is Express because I want to see the console console pops up when I run it from itself a self-hosted console there's the console and notice here if we scroll the top we have info and then what's going on we have info and what's going on all the way down here we have lots of information events this is logging and it's baked into Microsoft's code so Microsoft has put logging into their own code and said I logger can pick this up as well and so he captured things like let's look the very top here now listening on and there's the web URL for HTTP and the one for HTTP so you can captious information right out of Microsoft's coat that logger is picking that up as an information event so again read a box that happened so this is console logging we're logged to a console makes sense right and then over here in Visual Studio we have debug logging and if we move this over these are the this is the same information basically so if we come down here and debug it gets a lot more full with other stuff but notice the Microsoft hosting lifetime information now listening on and there's the HTTP port and the HTTP port so that that has captured the logging information as well so that's out of the box we don't configure anything it just kind of happened by magic and if you know me I'm not a big fan of magic because magic when it breaks is a major problem because now you have to learn how the magic works before you can even learn why the magic is broken before you can fix the problem and that to me is an issue so I want to know more about how this system works how its configured and how I can use it let's start off with the basics and the basics are that we want to change where we're logging to or at least control it ourselves instead of letting Microsoft control it behind the seats so it do that we have this this is how we we set up and run our application we first create the host builder with arguments that are passed in from the command line if there are any we then do the build action and then we do the run action and the build action comes down here this is the host I'm sorry this is the host builder so this is right this right here it comes down and it runs these configurations and then it builds it and then it runs it so what we're gonna do is modify this create host builder the configuration section and we are going to add in our own configurations so we have host create default builder that's where the I'll our gets configured by default and then we have configure web host defaults well we're gonna add another section in here and notice it's a little bit hard to see because of the lambda expression all the rest but we have this statement and then we have dot configure web hosting web host defaults well this can be chained this returns an I host builder so I can chain an additional action in here for example configure logging I can chain this at before or after the configure web host defaults in d4 so configure logging and then in here I have to I'm going to create a lambda expression that passes in two parameters first the context and second the logging information and I say lambda expression and then open and close curly braces and I'm all set so it looks just like this pattern here it's just as it says configure logging instead of configure web host defaults with that I can now change my configuration for my law let's do that let's start off by clearing out what Microsoft has done for us so logging dot clear providers that means clear out everybody that's listening for logging events next let's add some configuration now configuration is how we we configure our loggers what's listening who's listening what's listening to those types of things so ad configuration press a context that comes from this available right here context context dot configuration this is gonna pull from our app settings dot JSON or our key vault or whatever we have configured already to to have settings in or I get the section called logging okay and that's gonna be our configuration now what is that well by default we're already given this section and we're dizzy using it but this is an app settings JSON and if he knows we have a section called logging that's what I'm referring to and so when I say over here get me the section titled logging and then add that information that's what this is right here add that information into the add configuration it's going to take this entire section as an object and load it into the configuration so we have I'm sorry this section right here so I had one too few curly braces so the log level and then the settings underneath that and we'll get into what all these settings mean but for right now this is the default configuration that we get out of box with a web application so we're going to load that in by default configuration and then from there we're gonna add our own loggers things to log to so logging dot add debug that's the debug window that's the output right here that's what this is and then let's add one more logging dot add console and that's the the window we saw that started up our application or our website so we're adding two back in we're not adding all three back in just the two that we actually want to use so this is a good time I talk about what's provide out of the box where we get from Microsoft directly to log to now I'm gonna use debug and console today but there are other options for example one of the ones that by default is turned on is event source and that you have to use a tool to read and it's not something I've typically used but it's available to you we also have event log which is your like you say your Windows machine or I am not sure if it will write to Mac and Linux as well I assume it does but that would be your you know debug info warn critical events actually in your Windows machine your event log so your vent log a trace source I believe it's only for dotnet framework projects we also have as your app services file and also as your app services blob so those are two storage types in as your app services okay so you couldn't have guessed and those will store information so you can capture it on your edge or dashboard and see it directly from either a file on your web app so it stores file or files any web app or you can store a file in blob storage instead which usually makes a little more sense because the the file can get wiped away pretty easily but your blob storage can last a little longer and the big one that I'm not going to cover today but you really needed look into and I will do a separate video entirely on this and that is application insights application insights is what you can use for application telemetry to to find out what's happy with your application where is it operating all those types of things in Azure and it is a whole topic unto itself it's not something that can quickly give you the high-level overview of in this course or this video just because there's a lot to it and we'll make sure we get it right and so we're gonna do a whole video on application insights means they are quite important to any application especially ones that go into Azure now I believe these four right here do need to have a nougat package installed in order to add them but they are provided by Microsoft so they are Microsoft provided kind of first party loggers but for today we're just gonna focus on debug and console now if you're looking at this list and saying wait where's sequel server where's text files where is and there's a whole list of other things you could get and that's where we'll cover a little bit later but that's where you bring in a third party logging system that integrates into the I longer interface which allows you to add more things into this and have larger options with that though I'll emphasize it later as well but went emphasize it now to just we have it doubly covered and that is be careful what you're logging and where you're logging it to logging is supposed to be very very quick it's supposed to be just basic information and it should not slow your application down with that being said the way that this logging system is designed is it runs synchronously it does not have an asynchronous way of doing logging and that seems at first like a limitation however that's intentional and the reason why is because logging should not be a long rain process and if you have short running processes it's actually slower to make them asynchronous than to keep them as synchronous code so that's why they're synchronous but if you're looking at logging to something like let's say sequel server maybe you want to think about logging to an intermediate place first and then having something else a background process pick up that information input in a sequel server just so that lag time does not slow your main application down also note that logging is not supposed to be used for critical data this is we hope we get it in just throw it in keep going information this is not the we have to have this information in exactly this way logging does not guarantee that you will capture all the log files so just be be aware of that if you're looking to log specific information that has to be stored let's see what a transaction or it has to be stored no matter what and never removed maybe there's other options for you besides using the logging framework all right so that's enough kind of caveat stare at what make sure we were clear on that this is much more for informational purposes primarily for debugging and monitoring your application that's the primary purpose for logging so let's move on so what is happening right here well we're configuring our our system to use a specific type of logger from Microsoft right now and that logger now come across the aisle augur interface so that when we are on the index CS HTML CS code page we can ask for an ilogger and that will get our configured logger that we configured over here in program CS now let's just prove that that's the case by coming back to program Nazi s and turning off the debugger so no debug no debug output instead just the console if we run this and wait for it to start up you'll notice that while the there's calls going on in this output window here there's not going to be in the cons being on the console but not in the output window let's see any pause right here I'm not sure why it is paused oh I had to hit Enter ok so notice all these info messages that didn't hit this window over here they're not in the output there's no information messages at all instead it's just on the console so you've told the debugger you know what I don't need you I'm going to turn you off let's just go ahead and do it on the console so that is kind of indicates that yes we are operating correctly and we can turn either the debugger off or if you wanted to we could turn the console off and have just the debugger you'll notice all the events will pop up here but the console itself is just a blinking cursor even though our webpage is loaded so both options are available to you if you want just to kind of indicate that yes we are manipulating how the eye logger gets set up so let's talk through next this right here so we ask for an ilogger from our dependency injection system but we pass in a type of the class that we're currently in what does that do and why do we do it well this is what's called a category and this allows us to categorize our different messages in our logging system so let's run this again and we're going to look at those categories so this is the category right here that's the category name let's add our own message here on the on get so underscore logger.log info or information let's just give it a message this is our first logged message and let's watch the category is for this log statement now if I scroll up here we should find our message and there it is logging demo dot pages dot index model and then it has this zero in square brackets and it says this is our first logged message so there's our error message or our information message let's say so how does it know that it's logging demo dot pages index model well it pulls it off of that type notice with mouse over it says logging demo pages index model so it has pulled that full name off and uses that as our category for our log now we did not pass into our log information is any type of ID and that's something optional you can pass in so if we were to stop this I'll leave this open you can do that now we can leave leader window open it's just that's no longer attached to your application I'm gonna leave it open if we come back over here and do our control shift space this is our first overload for this but we do have this event ID and so if you want you can associate IDs with specific events and then you can either put them in as just an integer like so which seems like a BA a confusing process because you know he had to remember what is a thousand won was it mean or you can create a class that has constants in it so let's just say you create and we'll do it here just to show it off I'm not going to keep it but you could say public class logging ID let's call it like ID singular and then inside there could have a public Const int and let's call it demo code equals 1 0 0 1 like so and then up here we could say logging ID dots demo code like so and then you can reuse this everywhere and you can refer to it based upon the name but then it puts the ID number in there then when we run this we'll run it again and this time you'll have an ID besides that 0 in the square brackets all right so bring us over and up here always hard to find it first there we go our logging demo pages index model the ID is 1001 and it says this is our first logged message so if you want to have IDs that's the way of going about it you don't have to have IDs though you can just skip that and then not pass anything in all right next let's talk about the different levels of log so the the very bottom level the most probably the thing that you won't use very often but logger dot trace log trace this is a trace log and then logger dot log debug this is a debug log and then log information I'll just change that message to this is a n information log logger dots log warned or warning this is a warning log logger dot log error and finally logger dots log critical like so so these are different levels from least significant to most significant ok so let's talk through what each of these is generally used for and you can use it for your own thing but in general visit how these messages are used these two are mostly for pretty heavy debugging typically trace logs are logs that will have a really detailed view in what's going on and it may even have some application secrets in those trace logs next is debug and that's where you kind of the next level up from trace but it's still some pretty heavy debugging information about you know this is what the data is for this value or things like that information is more this is stuff youlet probably keep in your logs this is more a flow of how your applications are being used so we're going from step this step to this step to this step for this customer or things like that and you can kind of trace through how your application is being used a warning is where you have an issue let's just say you throw an exception that you catch so there's something that maybe the the user says open this file and the file wasn't there you would catch that exception because you've you've planned for the idea that the user gives you a bad file name but you'd want to log that as a warning now the next level is error and that's where there's an exception that may kind of crash part of your application it's unexpected it's unhandled at a low level me it it pops up quite a ways and you may can't do something for example maybe there's something where you know the database wasn't available temporarily that could be an exception that happens or when you went to write to the log file the log file was corrupted and it couldn't be written to and so you couldn't do that right that you were expecting to and so that would be that'd be an error and then critical this last one this is like the application is crashing the whole thing is down there's some kind of massive issue maybe you're losing data maybe there's you know a customer made a purchase but before you put a database something happened and you know you're losing that sale or the server is out of disk space and so the application has come to a crashing halt these are type of things that you log as critical logs in general the two most used in that you didn't capture are these two right here information what's going on and then warning what went wrong that we expected in general you don't you hope you don't have too many errors that were unexpected or that crashed sections of your application and for sure you hope that critical things don't happen but these are important things to remember to log let's just see these in the console just to see how this wood would look all right so let's grab the console and bring it back over here and we'll scroll up here and we have our debug this is our debug log we have our information we have our warning we have our failure or the error log and we have our critical which is a critical log so if you're scrolling through the console looking for issues they'll pop right out if they're warnings failures and critical for sure because of the color change so that's how you look in the console but whatever logging tool you use or logging output you use can be different and how it's displayed so over here if we look at the logging you can't tell a difference it they say the difference but that's about it so you can't really tell oh that's more importantly that's critical so that's the different logging levels now we do have the option of appending information in our message so I comment this out so you have these now let's logging levels okay and now let's look at the additional information you could put into a message so longer dot log let's do log error just so that we have that read to catch our eye so in here we can say our message is the server went down temporarily at time I put that in curly braces and then afterwards I put comma date/time dots UTC now now what's gonna happen is we're gonna take this value and put it in this spot and you may look at that and say Tim that doesn't look right it looks like we should have string interpolation which for a dollar sign there and then is put inside here date time UTC now and that was my first thought but there is a reason why we do it this way or why Microsoft did this way I say we I had nothing to do with it the reason why it's done this way is because there are certain logging frameworks that can log in a larger manner and that's called either semantic logging or structured logging and what will happen is they will store this information in a separate place usually in a JSON object or something similar we'll say time and then store the time and then display this message right here with the time inserted but that way when you go a search your logs you can actually filter based upon the time when the log was entered because you have this time in the as a separate variable so there is a benefit to not merging that into this one string that you send it a logger piece it has an argument then you can pull that back out later in certain logging frameworks now if you'll notice I call this time but how does it know that this right here is time and the way it does that is based upon position so it's it's just about this is the first parameter therefore I grab the first parameter value and put it into the first parameter spot so if I had another parameter say Tim then it would take Tim and put it in the time spot okay and just it's not because Tim start the TI m and time studs to show the same thing we just put it in that spot so make sure that your parameters are in the correct order for what you're inserting so if you insert a new parameter up here like so date time dot UTC now goes over here now not here if you want in both places you'd have to do something like this okay so that's how the logging works let's just again run it and see it in action and there's our failure and it says the server went down temporarily at and it has the date and time so decking a pretty powerful way of sending additional information to our log message we can get even more information if we have exceptions let us say we have a try catch and this catch as an e X and then inside here we're not going to read through the exception but instead we're a say logger dot let's do critical and say e X comma there was a bad exception and the time here all right so we've now passed in EXO the whole exception as part of our log message and this is one of the overloads for the different types of log messaging so they run this now let's pull it over here we see our fail right here the server went down temporarily at and that's our failure I don't see our other message ah and the reason why is we never threw an exception you should probably let me right now so throw new let's call it a it's kind of exception and say this is a you forgot to catch me okay that's our exception message and now if we run this we should get that that critical alert that something went wrong and in fact we do so this is the message notice it's actually all the way down to here so there is where it came from logging demoed up pages index model there was a bad exception and there is the time so that's the message that we created and then here is the system exception you forgot to catch me and where was it there is the location the source code and there's a line in the source code so that's how you catch an exception and pass it through to your logger now let's comment this and call it advanced logging messages so you can comment this out in just a minute but first I want to move on to the next piece which I promised you I'd get to and that is app settings dot JSON where we have this information and this is how the logging is configured so right now we only have one logging level configured and that is for everything is meta logging type so we're gonna change this but for right now let's look at what just this default does and it says by default I want you to log information only now if you caught it earlier when we called this whoops when we called this message right here these two I'm sorry this one it didn't capture trace information and that's because we weren't actually capturing that so we'll change that in a bit but by default it says log information level and higher but for Microsoft categories these are categories so for Microsoft categories I want you to show only warning messages and higher meaning Microsoft got some love information stuff in there don't capture that but then we have this more specific rule and that is Microsoft hosting dot lifetime and it says well actually you want to see information above the lifetime so what happens if we assign you know what we don't want anything from Microsoft well we could change delete this and change this to two none or two critical but we'd still see stuff from Microsoft so instead what we need is we need to have a little bit more generic rule by saying Microsoft Star and for that I want to see only let's do warning any kind of exceptions that are caught that's fine but for everything else I want this and I am going to even take these let's just change us to two warning as well because I want to leave it in here so you can see it but we don't want these to be anything below warning either now if we run this application you'll see a big difference in what gets logged there's our logs that's everything just 2 log entries and they're both from us are critical and our failure if we come back over here we comment out this section and we uncomment this section here we run it again we'll see debug info warn fail and critical now interestingly enough we're not supposed to be seeing this debug message at least not according our configuration and I believe in production he wouldn't but since we're running visuals to you it might be that's the reason but we're saying info and above and so we should be seeing just these messages not this one we don't see trace though so they can make over here to our app settings let's change the default to trace and run this again and see if we get a different result and we don't so let's do this let's close this down and let's look at we're gonna expand out let's change back to information we're going to expand out this logging section to be specific to a specific type in this case console and then inside here what we'll do is we will add our log level and then in here we'll set the default to be trace now let's run this and notice we get a lot of stuff in here including there's our trace debug info warn fail and critical so if we then add in the this right here where we say Microsoft you know what only show warning and above but for everything else for our stuff do trace then we should see just our trace message and above and there we go so trace debug info warned fail and critical so the console by default was not taking the log level from this default it was not it was ignoring that for what levels to capture and it was by default on its own defaults saying I want debug and higher and so this is where we can say well no actually I want you to be trace or higher so for console trace level or higher notice that that is not affect the the debug instead so we could set our own section here for debug as well so you say debug and the log level is going to be warning for both hours and Microsoft's and now if we run this and look at our output here we'll see a different scenario and that is that we have just three log messages and that is warning err and critical and over here in our window here we see trace debug info warn fail and critical because console has a different set of parameters than debug does so if you want make sure you specify different levels for different different outputs whether it be the console or the debug or if you use other things like event log this is how you do it you come into your app settings JSON and under the logging section you the top level is the name the type of logger so as case console or debug and then if you don't have one it takes it should take the log level before the default and that may happen in production is not in debugging mode I'm not positive on that one but this allows you to specify for sure what those levels are so I would recommend against ever deploying anything that had trace turned on I would say start off with your information and then the nice thing is because this is an app settings JSON file you can change it at runtime so you can change it to trace if you want to hear more information about what's going on inside of your application so that's why it's in these files instead of in code that's one of the questions I often get is well can't I do this inside c-sharp code and the answer is yes you can configure your logging information inside c-sharp code but there are limited reasons why you would want to do that and they're probably not as many reasons as you would think because in general you want to pull this from some external configuration system so that you can turn it on or off up or down depending on the client that's deployed on and the situation okay so there's the the different logging levels per logger there's a couple things I haven't covered yet one is so far we have just seen how to do this right here where we are passing in the knee the object that we're in the class that we're in and that captures and creates the category based upon the full namespace so logging demo dot pages dot index model but what if you wanted to change that and not use the class name for some reason now this is the convention to do it this way but if you decide you know what I don't want to do it that way instead what I want do is I want to do it where I specify what that name is first of all this isn't necessary either way you know say I lager because it is an ilogger you want to give the type and second if you want to change this let's just copy this I'm going to comment this out and then paste it back in so we can have a different version so I'll say this is the whoops yeah I was trying to do two double slashes so that I can when you uncomment it the comment is still here and this is the standard way of capturing the category well if you don't want to go the standard route you want to do it your own way so instead what you do is say I log or factory and I call it factory some people call it logger still that doesn't make sense to me so longer factory what you gonna do is you're going to say factory dot create logger and give it your category name so in this case I'm gonna say demo category if you spell it right and that's it I'm not gonna give it the logging demo dot pages dot demo category just law demo category that's it that's now the the category for these messages so if we run this again we'll see that that's the category name so the category name is now demo category so if you really want to change what your category names are that's how you do it you ask for a factory for the ilogger factory instead of the ilogger and then you create the logger and pass in this information and you may ask well is that less efficient to do it that way and the answer is no it's the same amount of efficiency as if you did the standard way like this now yes it's more lines of code but as far as c-sharp compiled code I'll kind of stuff it's the same because what happens is this right here what that's doing is it's passing in this type and that's doing a factory dot create logger and passing in the name because a name of and the type so it's the same thing whether you do it your own way or way to do it this way which is a more standard method the other thing that I haven't lis touched on but sometimes people want to do is over here in static void main the question comes up how do I log the my application started and that takes a couple of steps so right now we've chained the create house builder and then build and then run we're going to break that up into two steps so let's say var host equals like so and then we can say var actually let's do it up here I'll be consistent save our logger equals host services dot get required service and so am I using statement there and then I'm going to ask for an ilogger of type and let's give it program like so and now I have a logger so I've done is I've asked the dependency injection system for a service and that service has a logger and so now I have that I logger I can say logger dot log information the application has started like so we probably put the time and date those type of things in there certain log systems have a time date by default you'll need to pass in so and then afterwards after done that then we say host dot run to finish off what was in this chain so with all that being done let's make sure that we're actually capturing info I believe we are but yet we're capturing information messages so we pull this over here the application has started so that's how you'd capture the law use the logger when you're in your main method all right with all that being covered and I know cover it pretty quick but you can go back and kind of look at the different sections as you need them with all that being covered where you go from here well I think for to start off with you stop right here this is this is good enough this is will help you with debugging your application with making sure that you understand what's going on your application getting some telemetry there and maybe even with capturing information in Azure using the either that text file storage or the blob storage but maybe you want to to the next level maybe you want to have more formal logs or longer term logs where you capture more performance data and stuff like that how do you do that well it's actually pretty easy we're configuring the logger here if we replace this section with let's just say we want a third party service like serial log well Sarah log you add a couple of new get packages one being stare long itself and one being whatever sink they call them sinks so this this right here be a sink and this would be as well basically anywhere to descend data you add the sinks that you want and then instead of this section right here you just say you Sarah log and then pass in your configuration and you're done so we'll use the same I logger interface so that let's just say for now you build your applications using the built in Microsoft could figured I lager but down the road you say you know what I think that we you know didn't make the right choice or maybe we've grown out of the the base I logger from Microsoft we need go beyond this and store things in text files or JSON files or whatever and so we're going to bring in Sarah log not a problem you just changed things in program CS that's it all the existing logging information that you have in place will still work and that works with Sarah log instead of with your Microsoft default console and deep in the debug window so what I'm saying is it's very easy to upgrade if you're looking for recommendations I'll probably come out the video on Sarah logging I'm pretty happy with that tool but it's also tools like n log and Elma that you can bring in put in place here very easily another thing to do is to bring in that application insights like I said that'll be a separate video as well as we look at what application insights are and how could they can really benefit your applications especially take them into the cloud but those are the two things that you don't have to make decisions on now in fact I encourage you don't over architect your application start with just this and then as you see you need better logging or longer term logging such as as short term logging just while it's running but as you see that you need this longer term stuff it's not hard to turn on and then you can upgrade your application in just a couple of men it's alright so that is logging that's built right into any dotnet application hopefully you follow along hopefully you've you've seen a few things you want to improve in your applications and hopefully this was useful to you ASAT for if you have any questions you can't any thoughts leave them down the comments below I will try it best to answer every single one and get back to you and hopefully you have some good discussions on where you think you want this to go next alright thanks for watching as always I am Tim quarry [Music] you
Info
Channel: IAmTimCorey
Views: 97,656
Rating: undefined out of 5
Keywords: logging in .NET Core, .net core 3.0, iamtimcorey, tim corey, ilogger, c# ilogger, ilogger c# .net core, .net core dependency injection, serilog, serilog .net core, serilog .net core 3.0, ilogger configuration, visual studio 2019, c# logging tutorial, asp.net core, logging in .net core 2.2, logging in .net core api, ilogger example c#
Id: oXNslgIXIbQ
Channel Id: undefined
Length: 56min 56sec (3416 seconds)
Published: Mon Aug 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.