I have multiple sinks configured and I have a cuustom enricher that I want to apply ONLY to text based sinks like Console and RollingFile.
Is there a way to do this serilog ?
I have multiple sinks configured and I have a cuustom enricher that I want to apply ONLY to text based sinks like Console and RollingFile.
Is there a way to do this serilog ?
Yes, a sub-logger can do this:
Log.Logger = new LoggerConfiguration()
.WriteTo.Seq("https://your-server") // Not enriched
.WriteTo.Logger(lc => lc
.Enrich.WithProperty("SomeProperty", 42)
.WriteTo.Console() // Enriched
.WriteTo.File("logs.txt")) // Enriched
.CreateLogger();