Im trying to use ILogger inside a composer to log some information to the log file. If I register an ILogger with dependency injection inside the constructor, I get the below error:
I was able to get the instance of ILogger and use it like below:
public class ServerRegistrarComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
var logger = builder.BuilderLoggerFactory.CreateLogger<ServerRegistrarComposer>();
logger.LogInformation("Hello!!!");
}
}
How to get an ILogger in Composer
Im trying to use ILogger inside a composer to log some information to the log file. If I register an ILogger with dependency injection inside the constructor, I get the below error:
Error:
What is the right way to get an instance of ILogger here?
I was able to get the instance of ILogger and use it like below:
is working on a reply...