Skip to content

Invalid/Outdated ASP.NET Core sample #309

Open
@plachor

Description

@plachor

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions