30% OFF - Use code HANDSON30 for 30% off any course or Dometrain Pro! Browse courses →
  • Courses
  • Learning Paths
  • Blogs
  • Authors
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • From Zero to Hero: Logging in .NET

    Learn essential logging techniques in .NET to ensure reliable applications. This course covers built-in logging, structured logging with Serilog, and advanced features for production-ready code.

    About This Course

    If there is one topic that every single .NET developer needs to be proficient at, it's Logging. Logging is fundamental to every application that wants to run reliably in production. From APIs, and web apps, to Desktop apps and mobile apps or even games, logging should be in place to ensure you have the right information you need to know what is going on in your system. Logging will be crucial when something inevitably goes wrong and you need to troubleshoot it. In modern .NET, we are blessed with an excellent built-in logger, but it is also essential to be proficient in Serilog, the most popular logging library. In this course, Nick will translate years of valuable logging knowledge gained in the field, working on real projects so you can follow the path of success.

    Course Curriculum

    2h 56m 10 sections
    Welcome
    01:31 Free preview
    What will you learn in this course?
    01:18 Free preview
    Who is the course for and prerequisites
    00:48 Free preview
    What is Logging?
    01:58
    The simplest log entry
    01:48
    Log categories
    01:39
    Log Levels
    04:46
    Log providers (destinations)
    02:25
    Section recap
    00:34
    The modern .NET Logger
    03:03
    The log methods
    02:55
    Why simple logging isn’t good enough
    02:11
    What is Structured Logging?
    01:27
    The message template
    01:38
    Log entry parameters
    02:31
    Understanding the Log Category
    02:10
    Working with the Log Level
    05:20
    The log event id
    02:49
    Section recap
    00:54
    The logging packages
    05:27
    Host vs non-host console app
    03:52
    Customizing the loggers and providers
    03:09
    Log category configuration
    04:32
    Dealing with exceptions
    01:52
    What are Log filters?
    04:03
    Section recap
    00:50
    What is a provider?
    01:14
    Built-in providers
    01:59
    Using the Application Insights provider in ASP.NET Core
    05:01
    Using the Application Insights provider in a console app
    04:28
    Editing registered providers
    01:44
    Creating our own logger provider
    03:18
    Section recap
    00:47
    Log message template formatting
    02:08
    Dealing with complex objects
    02:55
    Log scopes
    04:43
    Checking for enabled log levels
    03:26
    Timed log entries
    06:55
    Changing the log level during runtime
    03:51
    Section recap
    01:07
    What is Serilog?
    02:19
    Creating a Serilog Logger
    02:25
    The concept of Sinks
    02:46
    The static Serilog logger
    01:35
    Simple Logger Dependency Injection
    02:04
    Integrating with the Microsoft Logger
    02:17
    File-based configuration
    02:37
    Log enrichment
    02:15
    Integrating with Application Insights
    02:32
    Dealing with Structured Data
    03:09
    Transforming Structured Data
    01:28
    Manually enriching logs
    02:05
    Timed Operations
    02:51
    Masking sensitive logs
    03:06
    Asynchronous processing
    02:31
    Creating your own Sink
    03:29
    Section recap
    01:11
    Why does it matter?
    01:41
    The LoggerMessage.Define method
    06:06
    The logging source generator
    04:07
    Section recap
    00:38
    What is monitoring?
    01:18
    Alerting in Application Insights
    01:50
    Error-based alerts
    05:23
    Query-based alerts
    03:34
    Section recap
    00:35
    Course conclusion
    00:26

    Meet Your Instructor

    Nick Chapsas

    Nick Chapsas

    Nick Chapsas is a .NET & C# content creator, educator and a Microsoft MVP for Developer Technologies with years of experience in Software Engineering and Engineering Management.

    He has worked for some of the biggest companies in the world, building systems that served millions of users and tens of thousands of requests per second.

    Nick creates free content on YouTube and is the host of the Keep Coding Podcast.

    View all courses by Nick Chapsas

    What's New

    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    From Zero to Hero: Testing with xUnit in C#

    Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#