In this video, you’ll learn how to handle exceptions and create logs in ASP.NET Core MVC 6/7/8 using best practices. Whether you're building production-ready APIs or web applications, managing errors and logging them efficiently is essential.
This step-by-step tutorial shows how to implement global exception handling, create structured logs using built-in .NET Core logging providers, and log errors to the console, files, or third-party systems.
🔧 What You'll Learn in This Video:
🔸 Importance of error handling in web applications
🔸 How to handle exceptions globally in ASP.NET Core
🔸 How to create and configure logging in ASP.NET Core
🔸 Log to console, file, or custom providers
🔸 Catch unhandled exceptions gracefully
🔸 Real-world setup for production-level apps
⏱️ Timestamps:
⏰ 00:00 – Introduction to Logging and Exception Handling in ASP.NET Core MVC
🛠️ 01:05 – Configure Log File Path in appsettings.json for Log Storage
🧾 02:40 – Create Custom Logging Class to Manage Logs
🔧 03:20 – Implement Logic to Write Errors and Exceptions to Log File
📌 18:55 – Apply Logging in Controller Actions and Trigger Manual Exceptions
🧪 26:15 – Test Logging Workflow and Error Handling in Action Methods
📁 28:00 – Replace Hardcoded Path with Application Path & Refactor Logging Logic
✅ 33:50 – Final Testing and Best Practices for Logging in ASP.NET Core
📌 Support & Subscribe:
👍 Like the video if it helped you
💬 Drop your questions or issues in the comments
🔔 Subscribe to Digital Coding for weekly tutorials: / @digitalcodings
🔔 Tap the bell icon to stay updated with our latest uploads!
📆 New content every week on ASP.NET, Hosting & DevOps
🎥 Watch More ASP.NET Core & .NET Videos:
👉 ASP.NET Core Important Topics Playlist
• ASP.NET MVC Core with Visual Studio | ASP....
👉 ASP.NET Core MVC Tutorials (Step-by-Step)
• ASP.NET Core MVC 6/7/8 Tutorials in Hindi ...
👉 Fix ASP.NET Core Errors & Common Issues
• TECH | Fix ASP.NET Core, Visual Studio & S...
👉 Deploy & Publish ASP.NET Projects
• Publish On IIS Server | Deploy ASP.NET Cor...
👉 SQL Server Basics & Advanced Queries
• SQL Server Tutorial | Learn SQL Queries, J...
👉 Database Connectivity in ASP.NET Projects
• Database Connectivity | Database Connectiv...
👉 Build Windows Services with ASP.NET
• Windows Services | Create Windows Service ...
👉 Cloud Integration & Hosting for .NET
• Cloud | Create Windows Service in C# | .NE...
#ASPNETCoreMVC #LoggingInDotNet #ErrorHandling #GlobalExceptionHandling #ILogger #DotNetLogs #ASPNETCore6 #ASPNETCore7 #MiddlewareErrorHandling #DotNetTutorial