Simple Injector: Register ILogger by using ILoggerFactory.CreateLogger()
Use the following registrations: container.RegisterInstance<ILoggerFactory>(loggerFactory); container.RegisterSingleton(typeof(ILogger<>), typeof(Logger<>)); Or, in case you are integrating Simple Injector into a generic host or ASP.NET Core application, make use of the .AddLogging() extension method to even inject a non-generic ILogger into your application components, as demonstrates in this ASP.NET Core Startup class: public class Startup { … public void … Read more