NET8 Blazor and Serilog

654 views Asked by At

I'm creating a new Blazor Application with NET8. In the main project, the "server" project that contains the Blazor Client, I tried to add Serilog adding at the top of the Program.cs

Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Debug()
                .WriteTo.Console()
                .WriteTo.File("logs/liu_api-.txt", 
                              rollingInterval: RollingInterval.Day)
                .CreateLogger();

builder.Services.AddSerilog();

after installing from the NuGet those packages:

  • Serilog.AspNetCore (also the 7.0.1-dev-00320)
  • Serilog.Extensions.Hosting (7.0.0)
  • Serilog.Sinks.Console (5.0.0-dev-00923)

Unfortunately, the Serilog.AspNetCore is not recognized.

https://i.stack.imgur.com/ATYbu.png

Is it possible right now to use Serilog with NET8?

0

There are 0 answers