I try to get only LogLevel.Information to get sent to Application Insight when using ILogger. I've tried to use create a filter but it doesn't seem to do anything (everything below Information gets logged as well):
This is what I've used to be able to set a breakpoint and make sure the filter actually is getting used, which it is:
logBuilder.AddFilter<ApplicationInsightsLoggerProvider>(logLevel =>
{
return logLevel >= LogLevel.Information; // Breakpoint here, seems to be working just fine
});
Is there any way to set the log level for what is being logged to Application Insights or is this a bug (or maybe by design)?
I'm trying to get everything up and running on .NET Framework 4.6.1 and not on dotnet core, if that matters.
I try to get only
LogLevel.Information
to get sent to Application Insight when usingILogger
. I've tried to use create a filter but it doesn't seem to do anything (everything belowInformation
gets logged as well):This is what I'm trying to get working:
This is what I've used to be able to set a breakpoint and make sure the filter actually is getting used, which it is:
Is there any way to set the log level for what is being logged to Application Insights or is this a bug (or maybe by design)?
I'm trying to get everything up and running on .NET Framework 4.6.1 and not on dotnet core, if that matters.