Inject a dependency in a SeriLog enricher with autofac
问题 I want to create a Serilog Enricher injecting some data from a dependency. How can autofac inject my dependency into an enricher? This is my container setup: builder.Register((c, p) => { return new LoggerConfiguration() .Enrich.FromLogContext() .Enrich.With<MyEnricherWhichCanAddMoreDataFromADependency>() // ... .CreateLogger(); }).As<ILogger>(); While the enricher would look something like public class MyEnricherWhichCanAddMoreDataFromADependency : ILogEventEnricher { public