You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However in case of graceful shutdown you are not guaranteed that this code will ever be executed. Once host completes disposal it will terminate process in parallel most of time not reaching that line of code. In order to make it work every time you would need hook within those extensions methods from ASP or to add your own solution I believe.
Additionally you might update this template to use asynchronous overloads. As main can return Task now.
The text was updated successfully, but these errors were encountered:
Hi, in your sample sections there is a template how to setup Serilog with ASP. In this sample you suggest to log clean disposal of host (which would be great to do):
https://github.com/serilog/serilog-aspnetcore/blob/dev/samples/Sample/Program.cs#L22
However in case of graceful shutdown you are not guaranteed that this code will ever be executed. Once host completes disposal it will terminate process in parallel most of time not reaching that line of code. In order to make it work every time you would need hook within those extensions methods from ASP or to add your own solution I believe.
Additionally you might update this template to use asynchronous overloads. As main can return
Task
now.The text was updated successfully, but these errors were encountered: