Logging in WebAPI for DotNet6 (DotNet Core), using NLog.

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025
  • Do global logging in WebAPI. Learn how to use NLog with dependency injection in dotnet6, and how to build an application that uses logging in such a way that all errors are automatically caught and sent to the database. This example uses MariaDB but applies to any database, and also logs to a file. The same principles and code can be applied to non WebAPI templates such as MVC, or console applications.

ความคิดเห็น • 10

  • @DataVids
    @DataVids  2 ปีที่แล้ว

    I hope this NLog information helps you! Also, the video discusses throw and throw(exception), please disregard that and instead follow this information about throw vs throw(ex): stackoverflow.com/questions/730250/is-there-a-difference-between-throw-and-throw-ex (PS, thank you to Thomas Ardal for identifying this!)

  • @PIMARINE
    @PIMARINE 2 ปีที่แล้ว +2

    Bro never leave my waiting this long for another vid. I need my DataVids fix, weekly. 😀👍✌️

    • @DataVids
      @DataVids  2 ปีที่แล้ว +1

      For sure! Its been way to long since my last one. Hope you and yours are happy and healthy my friend.

  • @tabhorian
    @tabhorian 2 ปีที่แล้ว +1

    This was very useful and timely. Thank you!

    • @DataVids
      @DataVids  ปีที่แล้ว

      So glad! Have a great day!

  • @FourDollarBill
    @FourDollarBill ปีที่แล้ว +1

    Thank you! The video is very helpful and clear.

    • @DataVids
      @DataVids  ปีที่แล้ว

      Glad it was helpful!

  • @ThomasArdal
    @ThomasArdal 2 ปีที่แล้ว +1

    I think you got throw and throw ex mixed around. throw will include the original stack trace where throw (ex) will "restart" the stack trace at that line.

    • @DataVids
      @DataVids  2 ปีที่แล้ว

      rats! you are totally right. Thanks for pointing this out. I will need to edit that section of the video, but for now I will just pin a comment about this to the top. Thanks again

    • @ThomasArdal
      @ThomasArdal 2 ปีที่แล้ว

      @@DataVids Sure 👍🏻