public class MyController
{
private readonly ILogger _logger;
private readonly ILoggerFactory _loggerFactory;
public MyController(ILogger<MyController> logger, ILoggerFactory loggerFactory)
{
_logger = logger;
_loggerFactory = loggerFactory;
}
public ActionResult List()
{
ILogger<MyModel> modelLogger = _loggerFactory.CreateLogger<MyModel>();
MyModel model = new MyModel(modelLogger);
}
}