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

Sdílet
Vložit
  • čas přidán 22. 05. 2024
  • Did you know that .NET Core has logging built right into it? Do you know how to configure it or how it works? In this video, we are going to look at how logging works in .NET Core and how to make it even better. This video was built on .NET Core 3.0 but it will work in both older and newer versions of .NET Core.
    Source Code: leadmagnets.app/?Resource=Log...
    Newsletter signup (with exclusive discounts, giveaways, and more): signup.iamtimcorey.com/
    0:00 - Intro
    1:20 - Getting started: ASP .NET Core 3.0 demo application
    3:37 - ILogger in .NET Core application: where and how it is configured
    8:46 - ILogger configuration: Basic overview
    19:24 - ILogger configuration: Loggers
    21:35 - ILogger configuration: Implementation
    26:12 - Log Levels explained
    32:34 - Additional information in Log message: variables in the log message
    36:26 - Exceptions in Log messages
    38:51 - Logging configuration: appsettings.json
    47:06 - ILogger factory: custom log category
    50:36 - Logging the start of the application
    52:53 - Concluding remarks

Komentáře • 302

  • @mrterrbl8184
    @mrterrbl8184 Před 4 lety +98

    Tim, this channel is an absolute gem. You're a great teacher and I recommend you to everyone asking for C# help.

  • @gert-janvanderkamp3508
    @gert-janvanderkamp3508 Před 4 lety +44

    "I don't like magic, when it breaks down you have to figure it out first before you can fix it"
    ABSOLUTLEY YES.
    ASP CORE is brilliant in how it works, but boy does this configuration through extension methods obscure how simple it actually works. Both the services collection and pipeline, the core components of how it works, get obscured.
    Everyone creating anything serious shoud have a solid grasp of how the 'pipeline' (it's more of a trampoline) and the mvc routing mechanism work and how the classes it news up interact with the DI services. (maybe an idea for a video?)
    It's probably less work to go down understand that than to stare at the magic show and keeping your fingers crossed. Once you get it it really is so simple and elegant.

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +2

      I'll definitely be covering the different pieces of .NET Core as we go forward (and I'll have a start to finish course on it as well).

  • @LivingTheDream21
    @LivingTheDream21 Před 4 lety +2

    Very well explained, step by step and thorough. Answers all questions I would've had.

  • @vishalsjindal
    @vishalsjindal Před 3 lety

    Awesome, the way you explain, you actually every time hit the exact point what developers might be thinking.

  • @akshaynegi4849
    @akshaynegi4849 Před 4 lety +4

    this tutorial is amazing...I read the positive comments before starting the course and I am happy to take this course.

  • @wchishti
    @wchishti Před 2 lety

    Thank you for explaining all the behind-the-scenes logic. It was very helpful.

  • @lcee8325
    @lcee8325 Před 2 lety +1

    Thank you for an excellent video @IAmTimCorey! My favorite part: 53:02 "Where do you go from here? Well, ...to start off with, you stop right here." :]

  • @bhoopendrasharma9474
    @bhoopendrasharma9474 Před 4 lety +2

    Thank you, Tim, for such informative video about .NET core ILogger, videos on Serilog and ApplicationInsights would also be exciting. Thanks again...

  • @jameshoiby
    @jameshoiby Před 4 lety +19

    Tim, I've been using the basics in Serilog for quite a while and would love to see an in-depth discussion of the advanced features of Serilog. Thanks for the great videos!

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +3

      I will add your vote to the list. Thanks!

    • @utpmahesh444
      @utpmahesh444 Před 4 lety +1

      yes please. like logging exceptions in structured way

  • @mahimakapoor1315
    @mahimakapoor1315 Před 4 lety +6

    After wasting 2 days, I reached to this video...it's awesome..u simplified everything so smoothly...I can't even imagine to use this Logging without any help of yours..
    Thank u
    Thank u so much

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      Awesome! I'm glad this video was so helpful.

  • @dalmirogranas9990
    @dalmirogranas9990 Před rokem

    I keep getting back to this video over and over. Content is solid ❤️

  • @amalaljohari9358
    @amalaljohari9358 Před 3 lety +2

    I usually don't watch long videos since they are wasting of time, but your videos are gold, I listen to each word and don't waste any second of your valuable videos, you are great Tim, I hope you always create videos, we learn a lot from you

  • @KaKaPir
    @KaKaPir Před 4 lety +1

    Great video ! Looking forward to the Application Insights video

  • @alvinbernardo9551
    @alvinbernardo9551 Před 2 lety

    For all tutorials I have watch, you are the one explain it line by line

  • @SumanNath25
    @SumanNath25 Před 2 měsíci

    This was one the great content I have ever learned. Thanks Tim Corey.

  • @harag9
    @harag9 Před 4 lety +2

    Great timing Tim, I'm learning Core 2.2 (don't use VS2019 yet) - Looking forward to watching this in a day or two. Thanks!

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      Excellent!

    • @harag9
      @harag9 Před 4 lety

      @Senor Mike I would say 2nd best as Tim is the best. That aside, I'm also watching that guys core series, but I find the accent very hard to follow personally. I'm not good with peoples accent, nothing personal against the guy.

    • @harag9
      @harag9 Před 4 lety

      @Senor Mike Yes, understand, just takes me a while to tune into the accent - I'm starting to get into his now and carrying on with it, it's quite clear compared to some I've heard and don't get past the first 10 mins. I like Tims videos because I do mostly desktop as (winforms mainly) but he is branching out, and has to learn stuff as well (e.g. Xamarin).

  • @saddlebear
    @saddlebear Před 4 lety +1

    Great job Tim, thank you for this!

  • @josbexerr5166
    @josbexerr5166 Před 4 lety +1

    Gracias mister Tim Corey, emociando con el curso

  • @kapilrbagul
    @kapilrbagul Před 4 lety

    It’s great video. Loving all your videos Tim

  • @franciskhoury4288
    @franciskhoury4288 Před 2 lety

    You are helping me stay employed. Thank you very much, Tim!

  • @austinhummel5439
    @austinhummel5439 Před rokem

    Thanks Tim, another incredibly useful breakdown!

  • @ws8999
    @ws8999 Před 4 lety +1

    Another great video, Tim!

  • @antoniomarcos5664
    @antoniomarcos5664 Před 4 lety

    Nice explanation, Tim. Thank you.

  • @TheChodex
    @TheChodex Před 4 lety +1

    This is so much better then Log4Net in my opinion. Simple things like this are what made me fall in love with .NET Core. Everything I need just comes built-in!

  • @akberaliakber
    @akberaliakber Před 3 lety

    great job - you style is amazing

  • @viniciussantosaguiar9543

    Master teacher!! No words! The best!! Thanks!!!

  • @marceloleoncaceres6826

    Thanks Tim, great video

  • @eaglesofmai
    @eaglesofmai Před 3 lety

    Really nice explainations!

  • @harag9
    @harag9 Před 4 lety +2

    Great video Tim, much appreciated. Love how it's all built into core from the get go, will be great for short term logging. However for more long term would be good if you did a part 2 of this with something like NLog or Log4Net as an extension to this Demo. I use Log4Net in my winforms application but I hear good things about NLog (though never looked at it). I used v2.2 of core for this video and the only issue I noticed was the settings in the JSON file - it wasn't accepting "Microsoft*" only "Microsoft" but everything else worked for me in v2.2. Until next time!

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +2

      I will be doing a part 2 for this video to cover the available loggers. Serilog will be a big one because it can capture that structured logging (the variables inside the message) separately from the logs themselves. I'll try to add in NLog and/or log4net.

    • @harag9
      @harag9 Před 4 lety

      @@IAmTimCorey Excellent, Thanks Tim. Never heard of Serialog - so if this is the next best one to use, then I'm happy with going with that.

  • @laurenzvien
    @laurenzvien Před 3 lety

    Hi, Tim! Love this video. This is one of the things I really haven't implemented on the project I am building and this video really helped me to do just that. Also, hope you have a video about best way to implement toast notifications in ASP .Net Core MVC.. 😊

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      I don't have one like that yet. Check out Toastr: codeseven.github.io/toastr/

    • @laurenzvien
      @laurenzvien Před 3 lety

      @@IAmTimCorey thanks, Tim!

  • @mohitdahiya3102
    @mohitdahiya3102 Před 3 lety

    Thank you Tim for this tutorail.

  • @sethnejame6786
    @sethnejame6786 Před 4 lety

    Really enjoy your videos, Tim. . .thanks a million! Any word on when you'll release a video on logging + ApplicationInsights?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      No specific date but it is on the schedule. I was just reviewing some content this morning on this topic.

    • @sethnejame6786
      @sethnejame6786 Před 4 lety

      @@IAmTimCorey Excellent, thanks for your response. I just started receiving your emails and have subscribed almost everywhere. . .I'm coming from the frontend and learning C#/.NET with the help of your videos. They are fantastic and very easy to follow. Thank you for all that you do!

  • @mikekrzych
    @mikekrzych Před 4 lety

    Great video Tim.

  • @imanqoly
    @imanqoly Před 2 lety

    My headache relieved after this video bless you

  • @0i0l0o
    @0i0l0o Před rokem

    From now on, I'll just say For the Algorithm.
    Cause I am tired of writing that you are an outstanding teacher.

  • @ivandrofly
    @ivandrofly Před 4 lety

    8:20 Totally agree! I also hate leaving thing without understanding them...

  • @Fearer2601
    @Fearer2601 Před 3 lety

    Your channel is really amazing!

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      Glad you think so!

    • @Fearer2601
      @Fearer2601 Před 3 lety

      @@IAmTimCorey you are really explaining the basics, many people skip it and you wonder how they achieved their result!

  • @neopro688
    @neopro688 Před 4 lety

    very good, exelent content as usual

  • @sokkpupptz
    @sokkpupptz Před rokem

    i watched the whole thing but didn't what i came for which was how to log to files n=but still worth watching - thanks

  • @rennjaysoterio2543
    @rennjaysoterio2543 Před rokem

    Love the content!

  • @chetan_mali
    @chetan_mali Před 4 lety +1

    Perfect video on my perfect timing

  • @MrOneWorld123
    @MrOneWorld123 Před rokem

    49:00 I used that approach previously to use class name + object instance hash as category. That way I could track down zombie instances of classes.

  • @hananiahlinde1377
    @hananiahlinde1377 Před rokem

    Excellent content as always... would love to see a video on logging/configuring to Application Insights in Azure

    • @IAmTimCorey
      @IAmTimCorey  Před rokem

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @ivandrofly
    @ivandrofly Před 4 lety +1

    THANK YOU SIR!

  • @ashankasr
    @ashankasr Před rokem

    Great video.

  • @petrsindelar5
    @petrsindelar5 Před 3 lety

    Great job!

  • @jamesbest2221
    @jamesbest2221 Před 4 lety

    Thank you so much!

  • @chizobaheribert6606
    @chizobaheribert6606 Před rokem

    Thanks tim

  • @gauravsharma8220
    @gauravsharma8220 Před 2 lety

    thanks tim

  • @pipetabor2011
    @pipetabor2011 Před 2 lety

    Hi @IAmTimCorey First Thanks for the video, it was really helpful. Second, where can i find the Application Insights video that you mentioned?

  • @ramakrishnareddy7488
    @ramakrishnareddy7488 Před 4 lety

    Tim, Your videos are really helpful. Can u do a video on covering application insights to capture logs in real-time web apps

  • @gould10
    @gould10 Před 3 lety

    I was struggling with understanging the concept of logging in c# until I found this video. Very clear and straight forward. Thank you Tim.
    I have one question. What if I want to perform further actions with logging such as notifying users via email that something ocurred. If I want to utilize the ILogger interface and factory in inner layers (not on the controller) such as the services layer. How would be the best way to achieve this while keeping a clean architecture? Thank ou.

  • @jonyfrany1319
    @jonyfrany1319 Před rokem

    Thanks

  • @NelsonPRSousa
    @NelsonPRSousa Před 4 lety +2

    Hi Tim Corey,
    Just want to point out that at 41:45, Console was probably taking into account what you have specified in appsettings.Development.json, not appsettings.json. You guys should expand appsettings.json in Solution Explorer and see your settings for each environment (development, production, etc).
    Nice video anyway!

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      Did I have override settings in the development file at that point? I didn't think I did.

    • @NelsonPRSousa
      @NelsonPRSousa Před 4 lety

      @@IAmTimCorey You didn't, but appsettings.development.json was created by default and was being loaded

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      But does it have override settings for logging? If not, then this is using the main file. Dev is only used if it has the same option with a different value.

  • @thethomasproject
    @thethomasproject Před 4 lety +1

    Great video. Kind of shows the simple, simple of logging within .net core. I will become a Patreon subscriber! And if you like this video, you should too. What is shared is worth way more than $10 per month.

  • @Steveiwonder2004
    @Steveiwonder2004 Před 4 lety

    Thanks for this it was realllly useful, when can we expect the application insights follow up to this?

  • @6freeborn
    @6freeborn Před 4 lety

    Tim you are a GOD!

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      It sounds like it was helpful. I'm glad.

  • @luismendez9436
    @luismendez9436 Před 3 lety

    Cool!

  • @summerbreeze25syria
    @summerbreeze25syria Před 3 lety

    Thank you for your demonstration. I watched previously your Log4net tutorial and it was very informative, is it enough to apply either Log4net or ILogger?

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      I don’t understand the question. Yes, you can use log4net with ILogger. For .NET Core projects, I typically use Serilog though.

  • @davidliu243
    @davidliu243 Před 2 lety

    Tim, waiting for your NLog video

  • @steliosvasiliadis3480
    @steliosvasiliadis3480 Před 3 lety

    I am using nlog and i thnink i am satisfied

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      As long as it works for you, stick with it.

  • @rikudouensof
    @rikudouensof Před rokem

    Hello Tim, thanks for this. How can one do 8:50 to 19:24 on .Net 6?

  • @AdityaKumar-kt5lj
    @AdityaKumar-kt5lj Před 3 lety

    Nice video, helped me a lot to get started on Logging! Just a quick question: How do you configure logger that one request has the same GUID/SessionId/LogId throughout its lifetime? e.g. from Controller to BusinessLayer and from there to Repo all logged messages have the same guid.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      You would need to write code to make that happen. Create a request GUID and then capture that with every log statement.

  • @TraxxStudios
    @TraxxStudios Před 4 lety

    33:46 Also interpolation is avoided for performance reasons. Not every logger call results in something being logged, so we can avoid unnecesary interpolation in such cases.

  • @AboOmar385
    @AboOmar385 Před 3 lety

    Great video and structured one 👌
    But I have questions about the data to be logged itself from the best practices point of view
    Should I log every thing inside every layer in my app or API, or logging the most important ?
    I will appreciate if you share the best practices in logging in real world scenario for a real world app or API. Thanks alot

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      I can add that to the suggestion list. In general, log what you are going to use. If you aren't going to read the logs, don't capture that information.

  • @xavierlarocque9470
    @xavierlarocque9470 Před 4 lety

    Very interesting video! Is there any news for the videos about Application Insights?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      It is still on the list. I just haven't had the time to get to it yet.

  • @utpmahesh444
    @utpmahesh444 Před 4 lety +1

    Thank you. May I ask a question what is the different configure logging between host level and app level. I have seen in many articles that suggest to configure it inside startup

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      We are configuring it in startup here. Typically you want to configure it in startup so that you can log when the application starts and capture a failure to the logs.

  • @joshmonreal
    @joshmonreal Před rokem

    Hi, thank you for such an informative video! I have a question though. Does the built-in logging of Microsoft have an integration with Log Analytics? What I mean by this is, does the logs in Console or Debug get added to Log Analytics - assuming that the application is deployed in Azure App Service and has Log Analytics integration enabled?

  • @PushkarThakar
    @PushkarThakar Před 3 lety

    How to use iLogger from the class library (.Net Standard), which is added as a reference to the .Net Core MVC app

  • @TutorialsMethod
    @TutorialsMethod Před 3 lety

    Dear Sir! what is the best way to logging in microservices architecutre?which library should we use? Thanks

  • @fredywenger3785
    @fredywenger3785 Před 3 lety

    Very good and easy to follow video - thanks.
    Unfortunately, not what I have searched for.
    I (and I think many other developers) have the problem, that I have INTERNAL (kestrel) exceptions in the console:
    - not able to reproduce (with the app)
    - without a timestamp
    - without any help to found the reason for the exception
    => No idea how to search (and fix) the reason
    It would be nice, if you would take this problem and create a video to this theme (how to troubleshoot internal kestrel exceptions or similar.
    Anyway - really good video!

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      I'm not sure what type of internal exceptions you would have in Kestrel. You can't debug Kestrel itself and it doesn't often have issues. Maybe try screenshotting when you have an exception that is internal to Kestrel and then requesting help on something like Stack Overflow. Just make sure you do your research first on the displayed error.

    • @fredywenger3785
      @fredywenger3785 Před 3 lety

      @@IAmTimCorey : See my other posting to the other video, that describes my problem in detail (I have watched two of your videos today;-)
      I already have posted the exception (see other posting) at SO...

  • @NeffPedro
    @NeffPedro Před 3 lety

    Hello Tim, thanks for all your tutorials/videos. can´t seem to receive your Source code thru the link you have available?!

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      Check your spam filters, if still not there, If still not there, email me at Help@IamTimCorey.com

    • @NeffPedro
      @NeffPedro Před 3 lety

      Hello again Tim, just sent you email!

  • @wcdeich4
    @wcdeich4 Před 2 lety

    Hi, where can I find an example of manually sending information to the log inside the Program.cs or Startup.cs ?

  • @thethomasproject
    @thethomasproject Před 4 lety

    Sorry something else I forgot to mention is you had mentioned Azure logging. Would you consider a video on using it with the Azure App Services File and Azure App Services Blob?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      More Azure videos like these are coming. Thanks for the suggestions.

  • @larsoleruben
    @larsoleruben Před 3 lety

    This is SO HELPFUL, thanks a lot. Microsoft documentation stinks on this subject.

  • @esamcoding
    @esamcoding Před 3 lety

    Great video. the only thing that was not covered is: how to log what happens if the CreateHostBuilder(args).Build() failed. I need an ILogger even before that piece of code runs.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      You can declare the logger very early in the process and then re-implement it inside dependency injection. However, it won't necessarily catch very early errors. In those cases, you will need to rely on the event logs to capture why the application crashed so early in the process (since at that point, it is an issue outside of your code most likely).

  • @anishkumarsinha
    @anishkumarsinha Před 3 lety

    You have given deep information !! Thanks. I am using this video to make custom control of logging.
    You have given glimpse of Azure AppInsights telemetry , have you created video for same ? If yes please let me know.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      Not yet but it is on the list.

    • @anishkumarsinha
      @anishkumarsinha Před 3 lety

      @@IAmTimCorey I am eagerly waiting to have deep knowledge of telemetry so we can create custom telemetry.
      many thanks. you are true teacher !!.
      At the moment i am reading below article, to take knowledge....
      docs.microsoft.com/en-us/azure/azure-monitor/app/api-filtering-sampling#addmodify-properties-itelemetryinitializer

  • @zoltantorok1189
    @zoltantorok1189 Před 3 měsíci

    15:30 Did you ever do that video on application insights?

  • @haas1001
    @haas1001 Před 4 lety

    Thank Tim, great video. This is working, but the logname and logsource is nog working and won’t be read from the settings. How can I fix this?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      I'm not sure. Try downloading my source code and running it to see if it works. If it does, there is something to tweak in your code. If it doesn't, there is something to tweak in your environment.

  • @sudhakark403
    @sudhakark403 Před 3 lety

    Tim! please upload a step by step execution of .Net MVC project. I'm a beginner to .net core. I don't know how to build an MVC project for real-time.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      I will add it to the list. Thanks for the suggestion.

    • @sudhakark403
      @sudhakark403 Před 3 lety

      @@IAmTimCorey Tim! Why you removed your which . Net core in udemy?

  • @nirmaldanwesh
    @nirmaldanwesh Před 3 lety

    Is the application insights video available already ?

  • @darrellabney5017
    @darrellabney5017 Před 4 lety +5

    Hi - Great video, but how can I use logging in a non-web application?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +2

      The same way. Sometimes .NET Core projects don't have the Startup class for configuration but you can add it. You can do logging the exact same way for WinForms Core, WPF Core, Worker Services, .NET Core Console Applications, etc.

  • @mohamaddjelouah9332
    @mohamaddjelouah9332 Před 4 lety +1

    hi tim i wanted to ask u about charts and graphics can u plz recommend a nuget or library for using charts and data analyse i want to show for example how many incidents in days and thank u

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      I don't have one specific package to recommend. I would recommend looking at a few options, seeing which is popular, and then looking at their demos.

  • @malhaar707
    @malhaar707 Před 2 lety

    Hey, you didn't demonstrate how to use the logger inside the static method. I am not able to use inside the class static methods.

  • @kidcae
    @kidcae Před 3 lety

    Tim I just found your channel. I have subbed. Would you say the basic asp .net core logging is better than Log4Net? I am having a major issue with getting Log4Net to insert logs into a DB and I cannot figure it out :(

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      I recommend Serilog for .NET Core projects: czcams.com/video/_iryZxv8Rxw/video.html

  • @artemzaruba7150
    @artemzaruba7150 Před 3 lety

    Hi Tim! First of all want to say thank you for all of your videos and efforts!!
    I use console to output logs in .net core web app, but from the box there are only 5 messages from Microsoft.Hosting.Lifetime[0] about listening ports 5000 and 5001, app started, hosting environment, content root path. How can I set on full list of logs like you have in this video? Your example at 6:44. Thanks!

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      Check the filter settings in appsettings.developer.json. They are probably filtering more than what mine are in this video (this was a change in the template for 3.1 I believe).

  • @1prasadjoshi
    @1prasadjoshi Před 2 lety

    I am using SeriLog for logging in dotnet core 3.1. Can I write custom methods to log Login-Logout logs (And I want to write these logs in different table. As serilog is creating one Logs Table by default I want to write Login-Logout logs in LoginLogoutLogs table or something like that) And that logging will also have few more info like IP etc.

  • @moneyfresher3035
    @moneyfresher3035 Před 3 lety

    Hi Tim, Another excellent video. So what I understood is, we use third party logging like Serilog because the default logger provided by Microsoft is not able to write on text file or Database. is it correct ? Another question is while using Serilog, the default logger also keep running in parallel. does not it has any performance impact ?

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      Yes, using Serilog is an upgrade to the built-in logger. As for both running at the same time, no, Serilog takes over for the default logger.

  • @ericwhitchurch1001
    @ericwhitchurch1001 Před 4 lety +2

    Great tutorial! When do you hope to provide the promised Serilog addition?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      Not sure yet. I have a lot to cover with .NET Core 3 just coming out.

  • @manoharreddyn
    @manoharreddyn Před 4 lety

    Tim, request you to please do an video of Angular core in visual studio 2019.

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      I appreciate the suggestion but I won't be covering Angular directly in the next year at least. In order to learn Angular, you first need to learn JavaScript really well. I know tutorials skip that part, but it is unwise to do so. Then, there is a LOT to learn in Angular before you start integrating it into an ASP.NET Core project.

  • @jakob8724
    @jakob8724 Před 3 lety +1

    Is there no "before" source code? This one I got seems to be the final thing, I like to be able to type along.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      Nope, sorry. You will have to write your own code to test it out.

  • @toastyshrimp1882
    @toastyshrimp1882 Před 2 lety

    10:23 what is the term for "chaining" methods(?) like that? You hinted that it only works because of interfaces, and I've not really seen this kind of logic before, so I'm curious.

  • @FemilShajin
    @FemilShajin Před 4 lety

    Where are these logs located? And how to access those? Can we log performance (i.e. time taken for computing)for endpoint and method or there are better ways to do that??

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      If you are saving them as files, you get to choose where they are saved. If you are choosing console, they aren't saved anywhere, they are displayed on the console. Basically, you get to choose what type of logging to do and where to save it (if applicable). As for performance logging, yes you can capture performance but deep performance monitoring is probably better done with a perfmon tool.

  • @andywalter7426
    @andywalter7426 Před 4 lety

    Can you do a video to show the new logging with wpf. Because I saw it using aspnet and I saw a comment that said it was supported in wpf core but would like to see how it would work with wpf.

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      It works just the same, actually. I'm doing a course with it now (upgrading applications to .NET Core 3) and it will be in a video in a couple weeks as well (not with WPF, but with another non-web .NET Core project type).

    • @andywalter7426
      @andywalter7426 Před 4 lety

      @@IAmTimCorey Does it require the aspnet core packages to be installed? Because it appeared from the video that you have to use the aspnet core packages in order to use the new logging. When you do the video, will it be just a console app? Because if so, then it would make sense it still applies.

  • @sanketss84
    @sanketss84 Před 3 lety

    How does your terminal video change opacity when you drag it ?

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      I use a tool called MaxTo for positioning windows. That is what does it.

  • @fiddler-dv4or
    @fiddler-dv4or Před 4 lety

    Tim, do you know if there's any updates to this from core 3.0 to 3.1?

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety +1

      The main functionality, no. The only change is that Kestrel (one option for launching a web application) has some updated restrictions in the appsettings.json and appsettings.developer.json files that will limit what you see for logging from the Microsoft side of things (they reduced the chattiness of the app).

  • @sanketss84
    @sanketss84 Před 3 lety

    Whats the correct approach to implement logging for nuget packages and console apps. A lot of tutorials cover this for web apps only.

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety +1

      A lot of NuGet packages do not have logging for production. You would either need to do the logging internally or accept an optional ILogger from the caller. As for Console apps, they would act similarly to a web application.

    • @sanketss84
      @sanketss84 Před 3 lety

      @@IAmTimCorey got it

  • @gayandelan4466
    @gayandelan4466 Před 4 lety

    Btw does this cover tracing as well in asp dot net core

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      Are you asking about the Trace level or are you asking about trace statements in code or event tracing?

  • @zokymasa
    @zokymasa Před 3 lety

    Hi Tim, how can I delete the header of my log on my debug output window when debugging? For example, when I start my API, the first line is always the "info:" and the second line is my generated log message. How can I delete the first line so it doesn't show up?

    • @IAmTimCorey
      @IAmTimCorey  Před 3 lety

      I believe you need to disable the logging from Microsoft sources.

    • @zokymasa
      @zokymasa Před 3 lety

      @@IAmTimCorey My question was not good. What I wanted to ask is Is it possible to disable category output in .NET Core ConsoleLogger and DebugLogger?

  • @TrueTaladan
    @TrueTaladan Před 4 lety +2

    Good Tutorial. But i missed the most common logging in your video. Logging to file.

    • @IAmTimCorey
      @IAmTimCorey  Před 4 lety

      Logging to a file isn't something that is provided out of the box from .NET Core. You need to add your own provider like NLog or Serilog to do that.

    • @kussostyle
      @kussostyle Před 4 lety

      14:03 logging.AddFile("Path/yourAppName-{date}.log");

    • @rogerguess926
      @rogerguess926 Před 4 lety

      @@kussostyle do not think that timestamp is correct...