Christopher Long
Christopher Long
Explore posts from servers
CC#
Created by Christopher Long on 3/21/2023 in #help
❔ Serilog filtering
4 replies
CC#
Created by Christopher Long on 3/21/2023 in #help
❔ Serilog filtering
In the services I'm implementing it like this in the program.cs
// Configure logging
Log.Logger = new LoggerConfiguration()
.Enrich
.FromLogContext()
.Enrich
.WithExceptionDetails()
.WriteTo.Console(new JsonFormatter())
.CreateBootstrapLogger();

builder.Host.UseSerilog((context, provider, configuration) =>
configuration
.ApplyDefaultConfiguration(context, provider)
.IgnoreHealthChecksPath());
// Configure logging
Log.Logger = new LoggerConfiguration()
.Enrich
.FromLogContext()
.Enrich
.WithExceptionDetails()
.WriteTo.Console(new JsonFormatter())
.CreateBootstrapLogger();

builder.Host.UseSerilog((context, provider, configuration) =>
configuration
.ApplyDefaultConfiguration(context, provider)
.IgnoreHealthChecksPath());
However no logs are being filtered out
4 replies