serilog/serilog-extensions-hosting

[Question] Support for CreateBootstrapLogger()

lonix1 opened this issue · 4 comments

I read your blog article about CreateBootstrapLogger and am excited to use it.

I installed Serilog.AspNetCore which includes a reference to this library, and I thought that would be it. But it references an old 3.1.0 version, whereas the new bits are in the latest 4.1.0 version.

How do I use the latest bits?

@lonix1 All you have to do is reference Serilog.Extensions.Hosting 4.1.0 in your project, in addition to Serilog.AspNetCore.

  <ItemGroup>
    <PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
    <PackageReference Include="Serilog.Extensions.Hosting" Version="4.1.0" />
  </ItemGroup>

This is not really related to any of the Serilog projects. It's just how NuGet works: It resolves the dependency that a package declares, unless you tell it to use a higher version.

Thanks.

Is there a reason the new version is not included in the metapackage? Or will it be included at some point?

It's just a matter of time until a new stable release of Serilog.AspNetCore (4.0.0) ships. These are two independent libraries so it's normal for them to have different release schedules.

If you don't mind using a prerelease version, Serilog.AspNetCore 4.0.0-dev-00202 already includes Serilog.Extensions.Hosting 4.1.0.

Personally, I prefer to include these higher version overrides of the dependencies that I need, and periodically run Snitch to tell me which dependencies I can remove already (as new versions of my dependencies are released).

Thanks that snitch tool is really useful!