How to Use Serilog in ASP.NET Core Web API | .NET 6

preview_player
Показать описание
Logging is an important part of any application. As long as everything runs smoothly, you don't need it, but when you face any issue with your application, you better have logs that help you find the problem.

In this video, we will learn about Serilog and integrate it into an ASP.NET Core Web API application running on .NET 6.

00:00 Introduction
00:37 What is Serilog?
01:03 Why do I use Serilog?
01:42 Integrating Serilog in an ASP.NET Core Web API Project
04:21 Testing and Exploring Logging
05:24 Serilog: Provided Sinks
05:44 Serilog: Advanced Features

📌 Source Code:

📌 Serilog Sinks (Providers):

🔥 C#/.NET Bootcamp: The Fundamentals & more (Code FRIENDS10 for 10% OFF)*

📌 .NET Developer Roadmap

📌 YouTube Playlists:

✅ SUBSCRIBE FOR MORE VIDEOS

🚀 CONNECT & SUPPORT

CREDITS

* Affiliate Link: I earn a small commission at no additional cost
Рекомендации по теме
Комментарии
Автор

Initially, I forgot to add the appsettings.json file. ☺

ClaudioBernasconi
Автор

Thanks a lot, bro. Such an easygoing and helpful video. I love your videos lessons

m.muhammadsodiq
Автор

You're starting to sound much more natural and confident in these videos. Keep it up Claudio!

DennisIvy
Автор

Chrisp and upto the point. Thanks for the video. It helped.

nomeshg
Автор

Great video! I've spent embarrassingly long time trying to get serilog logging to console using the ILogger<T> from Microsoft.Extensions.Logging in asp.net 6 and using your config (adjusted for console sink) worked on the first try, thanks!

mateuszjaroszewski
Автор

can you make an video on how to do it using dependency injection with iLogger

jerryd
Автор

thanks for the video. How to use serilog in microservices? do we need to write container volume? or any other filesystem?

acp
Автор

Hi
I followed this tutorial and Serilog works great in the controller and in methods called by the controller.
Using DI from the constructor, the _logger is always resolved.
Except when I'm trying to log from a method that is run by a Hangfire background job.
The _logger always resolves to null (DI doesn't work).
I'm told register the logging service as a Singleton in the Program.cs file

How can I do this?

taherassaid
Автор

Thanks for the clear explanation
Where can I find the source code for this tutorial?

taherassaid
Автор

Hello! I think you forgot to put the link for the provider's page. Could you inform us?

maroquio
Автор

appsettings.json file still missing in the git repo..

petrbrozek
Автор

Hey I get error "Unable to resolve service for type 'Serilog.ILogger' while attempting to activate " I am using Serilog in another project in the same solution

sujoyinnovates
Автор

How would you config this to a database

ghosiazafar
Автор

wow, i thought i can copy appsetting from your source and its not there :(

aqkhana
Автор

Please don't explain if you will not write the code and only copy paste
and not show file or anything real i loss my time

inzzccs