Make .NET Logging EASY with Serilog | C# Microservice Course (Episode 3)

Опубликовано: 18 Февраль 2025
на канале: Roberts Dev Talk
23,826
540

Learn how to configure flexible logging for your C# .NET Core application using the excellent Serilog library. In this tutorial I'll show you how to configure Serilog, add logging to Console and File using sinks, configure message templates, the JSON formatter and more!

Source code: https://github.com/chrismroberts/csha...

☕️ Support us with a coffee! (Or.. beer 🍺)
https://www.buymeacoffee.com/Robertsd...

Serilog on Github:
https://github.com/serilog/serilog

List of available Serilog sinks (log destinations):
https://github.com/serilog/serilog/wi...

📧 📫 Join us on our developer journey! Sign up to our email newsletter:
https://robertsdevtalk.com

🐦 Follow us on Twitter:
  / robertsdevtalk  

🎶 Music by Epidemic Sound:
https://www.epidemicsound.com/referra...

0:00 Introduction
0:38 What are Sinks?
1:10 Required Packages
1:46 Configuring Serilog
4:18 The File sink and Minimum Event Levels
7:11 Log Message templates
9:30 Logging JSON messages
10:04 Conclusion

Disclaimer - some of our links are affiliate links, which means that we receive a small commission for any sales made via those links, at no extra cost to you - so a great way to support our channel! Thank you so much for your support 😊

#dotnet #csharp #serilog