Given this appsettings.json
{
"ApplicationInsights": {
"InstrumentationKey": "foobar",
"LogLevel": {
"Default": "Debug"
}
},
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"AllowedHosts": "*"
}
And this from startup.cs
public void ConfigureServices(IServiceCollection services)
{
var appSettingsSection = Configuration.GetSection("TD");
var appSettings = new AppSettings();
new ConfigureFromConfigurationOptions<AppSettings>(appSettingsSection).Configure(appSettings);
services.Configure<AppSettings>(appSettingsSection);
services.AddApplicationInsightsTelemetry();
services.AddTransient<IMyService, MyService>();
services.AddControllersWithViews();
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp";
});
}
Why am I still only seeing Critical, Error and Warning in my AI output?
e.g. from arbitrary logs from a controller
public async Task<IActionResult> MyAction(string foobar)
{
Logger.LogDebug($"Ilogger debug {foobar}");
Logger.LogInformation($"Ilogger info {foobar}");
Logger.LogWarning($"Ilogger warning {foobar}");
Logger.LogError($"Ilogger error {foobar}");
Logger.LogCritical($"Ilogger critical {foobar}");
}
According to the microsoft docs here
ApplicationInsightsLoggerProvider is enabled by default in Microsoft.ApplicationInsights.AspNet SDK version 2.7.1 (and later) when you turn on regular Application Insights monitoring through either of the methods:
- By calling the UseApplicationInsights extension method onIWebHostBuilder (Now obsolete)
- By calling the AddApplicationInsightsTelemetry extension method on IServiceCollection
So I am a bit lost as to why the Debug/Info traces are not being output.
There are no overrides or logging settings in appsettings.development.json.
I am using AppInsights SDK 2.13.1.
Asp NET Core 3.1.
