I have a Blazor server web app running on Azure app services. When my code starts, as suggested, I have the following:
if (builder.Environment.IsDevelopment())
{
builder.Logging.ClearProviders();
builder.Logging.AddJsonConsole();
builder.Logging.AddDebug();
}
Now for production on an Azure app service, please correct me if I m wrong, as I change nothing it ll set up the following providers (assuming I don t make any calls) - is this correct?
- Console
- Debug
- EventSource
- EventLog (Windows only)
And that feeds them across with all the {name} key:values and scopes passed to be displayed as desired - correct?
Question: Where does the Console & Debug providers go in production on Azure app service? I believe the Console goes nowhere unless I turn app logging on (max 12 hours). Is that correct? And where does Debug go?
Question: When I turn on log to the stream in Azure and set it to verbose/debug, it ignores the configuration I set in the appsettings.json and is giving me debug level log output for namespaces I set to warning. Shouldn t appsettings.json stop those log statements from ever getting to Azure?
Question: Is the following the correct way to add in Application Insights?
if (useApplicationInsights)
{
builder.Logging.AddApplicationInsights();
builder.Services.AddApplicationInsightsTelemetry();
}