From Zero to Hero: Logging in .NET

Master the feature every single .NET application needs

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: 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
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
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
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
Deep Dive: Solution Architecture
course

Deep Dive: Solution Architecture

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

Learn More
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
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
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
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