Skip to content

Commit 08e6c69

Browse files
authored
Merge pull request #1675 from Aghyad85/patch-1
AB#1944: Update functions-monitoring-appinsightslogs.md
2 parents d499372 + 61943ae commit 08e6c69

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

support/azure/azure-functions/monitoring/functions-monitoring-appinsightslogs.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Application Insights logs are missing or incorrect
33
description: Ths article helps you resolve issues related to missing or incorrect logs for Application Insights logs in Azure Functions.
4-
ms.date: 08/24/2023
5-
ms.reviewer: gasridha, v-jayaramanp
4+
ms.date: 01/16/2025
5+
ms.reviewer: gasridha, v-jayaramanp, agaltrai, jarrettr
66
ms.custom: sap:Monitoring using Application Insights, Metrics and Alerts
77
---
88

@@ -30,6 +30,23 @@ If the Application Insights logs are missing, or if the data appears to be parti
3030

3131
**Recommendation**: The function app should be on version 4 and the runtime version should be at least 4.15.2*xx*. This is because, from this version onwards, you can track the log flows from Azure Functions to the Application Insights service. By monitoring the log flows, you can check for missing logs.
3232

33+
## Custom application logs
34+
35+
By default, custom application logs you write are sent to the Functions host, which then sends them to Application Insights under the [Worker category](/azure/azure-functions/configure-monitoring#configure-categories). However, some language stacks allow you to send the logs directly to Application Insights, which gives you full control over how logs you write are emitted. In this case, the logging pipeline changes from `worker > Functions host > Application Insights` to `worker > Application Insights`.
36+
37+
The following table summarizes the configuration options available for each stack:
38+
39+
| Language stack | Where to configure custom logs |
40+
|-|-|
41+
| .NET (in-process model) | `host.json` |
42+
| .NET (isolated model) | Default (send custom logs to the Functions host): `host.json`<br/>To send logs directly to Application Insights, see [Configure Application Insights in the HostBuilder](/azure/azure-functions/dotnet-isolated-process-guide#application-insights). |
43+
| Node.JS | `host.json` |
44+
| Python | `host.json` |
45+
| Java | Default (send custom logs to the Functions host): `host.json`<br/>To send logs directly to Application Insights, see [Configure the Application Insights Java agent](/azure/azure-monitor/app/monitor-functions#distributed-tracing-for-java-applications). |
46+
| PowerShell | `host.json` |
47+
48+
When you configure custom application logs to be sent directly, the host no longer emits them, and `host.json` no longer controls their behavior. Similarly, the options exposed by each stack apply only to custom logs, and they don't change the behavior of the other runtime logs described in this article. In this case, to control the behavior of all logs, you might need to make changes in both configurations.
49+
3350
## Logs are missing or partial
3451

3552
Application Insights collects log, performance, and error data. [Sampling configuration](/azure/azure-functions/configure-monitoring#configure-sampling) is used to reduce the volume of telemetry. The Sampling feature is enabled by default with the settings shown in the following [host.json](/azure/azure-functions/functions-host-json#applicationinsights) example. Excluded types aren't sampled.

0 commit comments

Comments
 (0)