Application logs are not emitted directly to Application Insights, but are being relayed through the Function host with host.json taking effect #2935
Labels
Needs: Triage (Functions)
potential-bug
Items opened using the bug report template, not yet triaged and confirmed as a bug
Description
I'm configuring my Azure Function app to send logs directly to Application Insights, as documented here:
https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#application-insights
This should allow me to configure logging in the application only (e.g. appsettings.json), without host.json having affect on the Application Insights emitted logs.
However, when running the Function app in Azure, debug logs are not sent to Application Insights, unless I modify host.json with
logging.logLevel.Function: "Debug"
. Doesn't this mean that application logs are actually sent over the Function host, i.e.Worker -> Functions host -> Application Insights
instead ofWorker -> Application Insights
?How can I sent application logs directly to Application Insights?
I have the required package references in .csproj:
Program.cs:
Steps to reproduce
Create a Function app and configure it to sent application logs directly to Application Insights as documented here:
Configure the application with a logging filter for a category set to "Debug" and write debug logs with this category. Only logs with "Information" level or above are sent to Application Insights, as this is the default setting for host.json's logging.logLevel.Function setting
The text was updated successfully, but these errors were encountered: