Serilog's ILogger injected using Log.ForContext<T>, where T is the consumer
问题 Serilog allows creating a context-aware logger: Log.ForContext<T>() I would like to register Serilog with SimpleInjector in such a way that T is the type of the consumer, i.e. it is which class it is injected in to. e.g. public class Car { public Car(ILogger logger) <= would be injected using Log.ForContext<Car>() { } } I can see this has been done with AutoFac. And looking through the SimpleInjector documentation, there is a very promising overload of RegisterConditional() (with the Func