Instead of requesting an ILoggerFactory and creating an instance of ILogger explicitly, you can request an ILogger (where T is the class requesting the logger).
public class TodoController : Controller
{
private readonly ILogger _logger;
public TodoController(ILogger<TodoController> logger)
{
_logger = logger;
}
}