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?
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?
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();
}
thanks - dave