how to use ilogger without dependency injection
public static class MyLogger
{
public static ILoggerFactory MyLoggerFactory { get; }
static MyLogger()
{
MyLoggerFactory = LoggerFactory.Create(builder =>
{
builder
.AddFilter("Microsoft", LogLevel.Warning)
.AddFilter("System", LogLevel.Warning)
.AddFilter("LoggingConsoleApp.Program", LogLevel.Debug)
.AddConsole()
.AddEventLog();
});
}
}
..In Class...
private readonly ILogger _logger = new Logger<claTwilio>(MyLogger.MyLoggerFactory);