Skip to main content
CF

.NET Logging Done Right: An Opinionated Approach Using Serilog

5h 2m 40s
English
Paid

This course shows you how to use Serilog to build clear and useful logs in your .NET apps. You will learn what to log, how to log it, and how to read the results with ease.

What You Learn

You explore four key areas to log. These areas are usage, performance, errors, and diagnostics. You see why each area matters and how it can guide your work.

Logging Focus Areas

Usage

You learn how to track what users do in your app. This helps you see patterns and find weak spots.

Performance

You measure how long parts of your app take to run. This helps you spot slow code early.

Errors

You record clear error details. This helps you fix issues fast and avoid repeat bugs.

Diagnostics

You capture context about your app at run time. This gives you a full picture when problems appear.

Global Logging Setup

You set up logging in one place. You do not repeat logging code across many files. This lets you focus on your core work.

You see how to apply this setup in ASP.NET, WPF, WCF, and TypeScript or JavaScript apps. Each example shows where logs start and how data flows.

Search and View Logs

You learn how to store logs in SQL Server and Elasticsearch. You also learn how to search, filter, and view the data. These tools help you explore your app and measure how it runs.

Practical Outcomes

By the end, you know how to design a solid logging plan. Your logs will be clear, useful, and easy to review. This helps you and the teams who depend on your work.

About the Author: Pluralsight

Pluralsight thumbnail

Pluralsight is one of the largest enterprise-focused online technology training platforms in the world, founded in 2004 by Aaron Skonnard and acquired by Vista Equity Partners in 2021. The platform has historically been the dominant choice for corporate IT training, with a catalog of over 7,000 courses covering software development, IT operations, security, data, and cloud across virtually every major vendor and open-source platform.

The instructor roster includes Microsoft Regional Directors, AWS / Azure / GCP MVPs, and named experts in essentially every active technology track. Course material is structured for the corporate-training market: each course covers a specific skill at a defined depth, and Pluralsight's role-based learning paths are widely used by enterprises for upskilling engineering teams.

The CourseFlix listing under this source carries 12 Pluralsight courses — a small slice of the broader platform's catalog. Material is paid; Pluralsight itself runs on a monthly / annual subscription on the original platform, with Pluralsight Skills (individual) and Pluralsight Flow (engineering analytics) as the main product lines.

Watch Online 65 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 65 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Course Overview
All Course Lessons (65)
#Lesson TitleDurationAccess
1
Course Overview Demo
01:45
2
Define Goals and Objectives, Introduce Serilog, Outline Course
09:52
3
Introduction: What to Log and How to Log It
05:08
4
Create the Global Logger
03:31
5
Add a Performance Tracker
01:42
6
Logging with a Console App
05:37
7
Discussion: Exception Handling and Data Access
01:20
8
Data Access Before Custom Exception Handling
03:43
9
Create an ADO.NET Stored Procedure Wrapper
02:00
10
Create a Dapper Extension Method
01:29
11
Create an Entity Framework Command Interceptor
02:06
12
Verifying the Custom Data Access Exception Handling
03:41
13
Add the Procedure Name and Exception Method to Top Level of Log Entry
02:10
14
Summary
00:26
15
Introduction and Approach
03:59
16
Utility Methods: Data to Log
06:29
17
Performance Logging: Web Forms
06:13
18
Performance Logging: MVC
04:03
19
Utility Methods: Web Logging Methods
01:38
20
Error Handling: Web Forms
09:25
21
Error Handling: MVC
07:10
22
Usage and Diagnostics: Web Forms
02:38
23
Usage and Diagnostics: MVC
02:52
24
Summary
00:38
25
Introduction and Approach
05:14
26
Review of Existing WebAPI Project
10:47
27
Performance (and Usage) Logging
07:12
28
Exception Handling and Logging
10:42
29
Summary
00:43
30
Introduction and Approach
05:21
31
Introducing a JavaScript Page on a MVC Website
04:24
32
Implementing a Logging API
03:06
33
Instrumenting JavaScript Code for Logging
06:30
34
Introducing the Angular 4 App
10:31
35
Instrumenting the Angular 4 App for Logging
09:40
36
Summary
01:05
37
Introduction and Approach
02:39
38
Introducing the WPF and WCF Applications
04:52
39
Applying Logging to WPF
07:51
40
Applying Logging to WCF Using Behaviors and Attributes
13:27
41
Executing the Apps and Reviewing the Logs
05:56
42
Summary
00:54
43
Introduction
04:15
44
Demo Approach
01:51
45
MVC App: Running the Existing Code
02:02
46
MVC App: Existing Code Walkthrough
05:42
47
API: Running the Existing Code
01:51
48
API: Existing Code Walkthrough
03:44
49
Building the Utility Logging Code
06:43
50
Ad-hoc Usage and Diagnostic Logging
05:41
51
Filter-based Performance Logging
06:26
52
MVC Exception Logging with Middleware
05:09
53
API Exception Logging with Middleware
04:57
54
Summary
01:09
55
Logging Goals and Sink Options
08:41
56
Writing to a SQL Server Sink and Verifying Entries
07:42
57
Using a Custom Web Viewer to Review Log Entries
04:58
58
Using an SSRS Report as a Dashboard of Sorts
02:21
59
ELK Stack Intro and Hosting It in a Docker Image
05:05
60
Writing to an Elasticsearch and Verifying Entries
03:59
61
Configuring Index Patterns with Kibana
01:30
62
Log 'Discovery' with Kibana
04:09
63
Log 'Visualization' and 'Dashboards' with Kibana
09:10
64
Changing an Analyzed Field in Kibana
03:28
65
Summary
01:38
Unlock unlimited learning

Get instant access to all 64 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What are the prerequisites for enrolling in this course?
Before enrolling, you should have a basic understanding of .NET development. Familiarity with ASP.NET, WPF, WCF, and JavaScript or TypeScript is beneficial since the course includes examples in these areas. Prior experience with logging concepts will be helpful but is not required, as the course covers the fundamentals of logging using Serilog.
What projects or applications will I work on in this course?
The course includes practical examples where you apply logging techniques to various applications. You will work with ASP.NET, WPF, WCF, and TypeScript or JavaScript apps. Each platform demonstrates how to set up and manage logging from a central point, ensuring you grasp the concept across different environments.
Who is the target audience for this course?
This course is aimed at .NET developers who want to enhance their logging strategies using Serilog. It is suited for developers who work on applications using ASP.NET, WPF, WCF, JavaScript, or TypeScript and are interested in improving their skills in tracking usage, performance, errors, and diagnostics.
How does this course compare in depth and scope to other logging courses?
This course provides a focused approach to logging in .NET applications using Serilog. It emphasizes practical outcomes, such as setting up a global logging configuration and storing logs in SQL Server and Elasticsearch. The course covers four key areas of logging: usage, performance, errors, and diagnostics, providing a comprehensive understanding that may not be covered in other general logging courses.
Which platforms and tools are used in this course?
The course uses Serilog as the primary logging tool. You will learn how to integrate Serilog in ASP.NET, WPF, WCF, and JavaScript or TypeScript applications. For log storage and analysis, the course covers SQL Server and Elasticsearch, teaching you to search, filter, and view log data effectively.
What topics are not included in this course?
The course does not cover advanced data analysis or visualization techniques outside the context of logging. It focuses specifically on logging within .NET applications and does not delve into logging practices for non-.NET environments or other unrelated development topics such as frontend design or business logic implementation.
What is the expected time commitment for completing this course?
The course comprises 65 lessons. While the total runtime is not specified, a typical student may expect to spend several weeks to fully engage with the material, depending on their prior experience with .NET and logging concepts. The hands-on examples and exercises require additional time to implement and understand thoroughly.