DEV Community

loading...

Discussion on: What every ASP.NET Core Web API project needs - Part 1 - Serilog

Collapse
rafalpienkowski profile image
Rafal Pienkowski

Nice article.

There is one thing that you should be aware of when it comes to the Console sink. I’ve seen that you used it with the docker container.
Serilog’s Console the sink is synchronous and has no buffer. That means during the high load it slows down your application. The tread waits until the log is written. As a solution, there is an async sink nuget package. It introduces asynchronously logging and configurable buffers.
As a side note, other sinks like SQL, Application Insights are asynchronous by design.

Collapse
moesmp profile image
Mohsen Esmailpour Author

Yes, you right @rafal
I think using console sink with docker container it's not a good idea and doesn't make sense. I just wanted to make an example of how to override configuration. I'm going to change it with a proper example.

Collapse
rafalpienkowski profile image
Rafal Pienkowski

According to 12-factor-app it does have sense. I see your point of view. I just want to warn everyone:)