NLog ConfigSettingLayoutRenderer - the best place to set configuration

Viewed 44

I would like to store some parts of the Nlog configurations (like DB connection string) at appsettings.json (production data are coming from the azure key vault) To do that I have to put something like that:

NLog.Extensions.Logging.ConfigSettingLayoutRenderer.DefaultConfiguration = configuration;

Assuming that I'm using the Blazor Server side app, where is the best place to put that line?

1 Answers

The entry point sounds like a good idea, so Program.cs for Blazor Server apps.

Program.cs is the entry point for the app that starts the server and where you configure the app services and middleware

From Blazor Server Tutorial

Related