feat: log to seq

This commit is contained in:
sam 2024-10-13 01:29:08 +02:00
parent d221441c10
commit ca99bdfb94
3 changed files with 11 additions and 0 deletions

View file

@ -48,6 +48,14 @@ public static class StartupExtensions
// The default theme doesn't support light mode
.WriteTo.Console(theme: AnsiConsoleTheme.Sixteen);
if (config.Logging.SeqLogUrl != null)
{
logCfg.WriteTo.Seq(
config.Logging.SeqLogUrl,
restrictedToMinimumLevel: LogEventLevel.Verbose
);
}
// AddSerilog doesn't seem to add an ILogger to the service collection, so add that manually.
builder.Services.AddSerilog().AddSingleton(Log.Logger = logCfg.CreateLogger());