Hi Ronald, you should put your code in your program.cs like the pic below
Hope it helps~
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to follow along with a tutorial at the following link https://www.roundthecode.com/dotnet/create-your-own-logging-provider-to-log-to-text-files-in-net-core that will add logging to my application. But when i look at my Program.cs file I dont know where to put the below code. Thank You !!!
public class Program
{
...
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureLogging((hostBuilderContext, logging) =>
{
logging.AddRoundTheCodeFileLogger(options =>
{
hostBuilderContext.Configuration.GetSection("Logging").GetSection("RoundTheCodeFile").GetSection("Options").Bind(options);
});
});
}
Hi Ronald, you should put your code in your program.cs like the pic below
Hope it helps~