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.
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!)
Bro never leave my waiting this long for another vid. I need my DataVids fix, weekly. 😀👍✌️
For sure! Its been way to long since my last one. Hope you and yours are happy and healthy my friend.
This was very useful and timely. Thank you!
So glad! Have a great day!
Thank you! The video is very helpful and clear.
Glad it was helpful!
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.
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
@@DataVids Sure 👍🏻