C# Logging with Serilog and Seq - Structured Logging Made Easy

preview_player
Показать описание
Structured event logging is so much more than just writing a message to a file. Since .NET Core natively supports structured event logging, I wanted to introduce a logger that takes advantage of these additional features. Serilog is an easy to configure and easy to use logging system that you can plug into a .NET Core project within minutes. Today we are going to configure Serilog, see how to use it in a basic logging scenario, then take advantage of the structured logging by hooking up a visual event sink called Seq.

0:00 - Intro
1:29 - Getting started: ASP .NET Core application
4:18 - Built in logging system crash course
8:08 - Exceptions in log messages (built in)
10:27 - Additional information in log message: variables in the log message (built in)
13:42 - Setting up Serilog
17:33 - Serilog NuGet references and configuration
21:38 - Logging application start and crash with Serilog
24:35 - Use Serilog over default built in logging system
29:47 - Serilog Enrichers: settings and NuGet references
32:27 - Writing the log messages to Console
34:29 - Logging request messages
38:11 - Writing the log messages to text file
40:49 - Structured logging: writing the log messages to json file
46:42 - Seq
48:39 - Setting up Seq with docker: NuGet reference, configuration, docker setup
59:15 - Logging with Seq
1:02:34 - Summary and concluding remarks
Рекомендации по теме
Комментарии
Автор

Tim Corey you are the man, there so much outdated info on serilog on the net

dustinbishop
Автор

I used to watch TheNewBoston and his tutorials and what have you. Then I found you. I have recommend you to so many people who want to get into c#. Keep up the fantastic videos!

marcturelles
Автор

Thanks for this awesome tutorial. It helped me a lot with switching my project to Serilog

aminebelbahar
Автор

fantastic intro into Serilog. thank you so much.

jerrydsta
Автор

Fantastic tutorial - especially running Seq on Docker. Thank you.

jrandallsexton
Автор

This is so valuable, thank you very much for this video i was able to adapt this and now have a centralized logging server for my Applications. i cant wait to try more things out with this and how Seq comes up comparing with Application Insights (much pricier, especially if you dont know exactly what are you doing).

baris
Автор

What an amazing explanation!!! Thank you so much.. this is a Loggin master class

davidpccode
Автор

Hi Tim really appreciate this video. Good job. Thanks.

wowDepressive
Автор

Awesome video, thanks for your contribution.

henryjao-ticv
Автор

really appreciate what you do, keep it up!
thank you!

saidakhmedagitaev
Автор

Loved the vid, good info! I did have a question thou, how about having multiple clients logging to Seq?

But after some research I connected the dots:
- Docker: you can mount multiple volumes (using the v: multiple times)
- Seq: creating API keys in the Settings-page (with Applied Property: ApplicationName) and consuming it in the clients
- Seq: in the overview you can use Signals > Application = 'ApplicationName' to filter on each client

Not that advanced but I guess not everyone will find it useful. But seeing web services are becoming very common now, it might be nice to know.

BabyGhost
Автор

Great Video...I really appreciate your videos especially when you introduce new nuget packages that I didn't know before.

numinaoneiron
Автор

Another amazing video, you have made my learning so much easier!

talcon
Автор

Amazing, informative video, thank you.

mgbaraka
Автор

Excellent course!! A great break-in to Serilog.

yonatandaniyel
Автор

This is a great video!!! I'm also concerned about how to maintain the logs so that they don't take a huge amount of space and then I run into trouble with my IT

samiboy
Автор

docker run -d --restart unless-stopped --name seq -e ACCEPT_EULA=Y -v D:\Demos\Logs:/data -p 8081:80 datalust/seq:latest

husam-ebish
Автор

Great video (just like the last I have seen from you).
Questions:
- Does Serilog also catch internal kestrel exceptions?
- Does Serilog also add the machine name of the calling client and the processid to internal kestrel exceptions if running on an internet server?

fredywenger
Автор

Thanks, 😁Could you also do video about serilog with elastic search, kibana and your opinion etc

galaxiegalaxie
Автор

Lovely. I would like to know if I can have different logging files. For instance one for errors and the other for any other information. This means I would want to have a separate file for errors

tumim