Since the recently introduced new structure of the Program.cs startup code, the documentation confuses me a bit.
In the officially provided Serilog.AspNetCore
example and in the Serilog.Sentry
example, they use .UseSerilog()
on the WebHostBuilder
. I cannot find this method.
This is what I have tried:
using Serilog;
var builder = WebApplication.CreateBuilder(args);
// adding services...
builder.Logging.AddSerilog(); // <- is this even necessary?
var app = builder.Build();
app.UseSerilogRequestLogging();
// configure request pipeline
app.Run();
But how / where can I configure the sinks, e.g. Debug, Console, Sentry, ...? I have the feeling that docs are a bit outdated or I am just a bit blind.