❔ Setting Up NLog with DI

I have my appsettings.json all set-up, and I have installed the nlog nuget. How do I set-up NLog to use with DI something similar to the below?
public static void Main(string[] args)
{
    IHost host = Host.CreateDefaultBuilder(args)
        .ConfigureServices(services =>
        {
            services.AddHostedService<Worker>();
            services.AddSingleton<ProcessingService>();
            services.AddSingleton<Utilities>();
           // services.AddSingleton<NLog>();
        })
        .Build();

    host.Run();
}
Was this page helpful?