How do I initialize an ILogger in a .NET 6 class library?
I’ve a class library, which is used by a console application. I now want to add a ILogger<T> via constructor injection in my class library. I came up with something like this: public class Class1 { private readonly ILogger<Class1> _logger; public Class1(ILogger<Class1> logger) { _logger = logger; } } Nevertheless I don’t know how I… Read More How do I initialize an ILogger in a .NET 6 class library?