You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While developing an application, you often want to see what's being written to the logs in near real time when running in Azure.
14
14
15
-
There are two ways to view a stream of log files being generated by your function executions.
15
+
There are two ways to view the stream of log files that your function executions generate.
16
16
17
17
## [Live Metrics](#tab/live-metrics)
18
18
19
-
When your function app is [connected to Application Insights](configure-monitoring.md#enable-application-insights-integration), you can view log data and other metrics in near real-time in the Azure portal using [Live Metrics Stream](/azure/azure-monitor/app/live-stream). Use this method when monitoring functions running on multiple-instances and supports all plan types. This method uses [sampled data](configure-monitoring.md#configure-sampling). _This is the recommended way to view streaming logs._
19
+
When your function app is [connected to Application Insights](configure-monitoring.md#enable-application-insights-integration), you can use [Live Metrics Stream](/azure/azure-monitor/app/live-stream) to view log data and other metrics in near real-time in the Azure portal. Live Metrics stream is *the recommended way to view streaming logs* it supports all plan types and is the method to use when monitoring functions running on multiple-instances. It also uses [sampled data](configure-monitoring.md#configure-sampling), so it can protect you from producing too much data during times of peak loads.
20
20
21
21
>[!IMPORTANT]
22
22
>By default, the Live Metrics stream includes logs from all apps connected to a given Application Insights instance. When you have more than one app sending log data, you should [filter your log stream data](/azure/azure-monitor/app/live-stream#filter-by-server-instance).
23
23
24
24
## [Built-in logs](#tab/built-in)
25
25
26
-
The App Service platform lets you view a stream of your application log files. This is equivalent to the output seen when you debug your functions during [local development](functions-develop-local.md) and when you use the **Test** tab in the portal. All log-based information is displayed. For more information, see [Stream logs](../app-service/troubleshoot-diagnostic-logs.md#stream-logs). This streaming method supports only a single instance, and can't be used with an app running on Linux in a Consumption plan. When your function is scaled to multiple instances, data from other instances isn't shown using this method.
26
+
The App Service platform lets you view a stream of your application log files. This method is equivalent to the output seen when you debug your functions during [local development](functions-develop-local.md) and when you use the **Test** tab in the portal. All log-based information is displayed. For more information, see [Stream logs](../app-service/troubleshoot-diagnostic-logs.md#stream-logs). This streaming method supports only a single instance, and can't be used with an app running on Linux in a Consumption plan. When your function is scaled to multiple instances, data from other instances isn't shown using this method.
27
27
28
28
---
29
29
@@ -37,7 +37,7 @@ Log streams can be viewed both in the portal and in most local development envir
37
37
38
38
1. In Application Insights, select **Live Metrics Stream**. [Sampled log entries](configure-monitoring.md#configure-sampling) are displayed under **Sample Telemetry**.
39
39
40
-

40
+
:::image type="content" source="./media/functions-monitoring/live-metrics-stream.png" alt-text="Screenshot showing how to view Live Metrics Stream in the portal.":::
41
41
42
42
## [Visual Studio Code](#tab/vs-code/live-metrics)
To view streaming logs in the portal, select the **Platform features** tab in your function app. Then, under **Monitoring**, choose **Log streaming**.
61
61
62
-

62
+
:::image type="content" source="./media/functions-monitoring/enable-streaming-logs-portal.png" alt-text="Screenshot showing how to enable streaming logs in the portal.":::
63
63
64
-
This connects your app to the log streaming service and application logs are displayed in the window. You can toggle between **Application logs** and **Web server logs**.
64
+
This setting connects your app to the log streaming service and application logs are displayed in the window. You can toggle between **Application logs** and **Web server logs**.
65
65
66
-

66
+
:::image type="content" source="./media/functions-monitoring/streaming-logs-window.png" alt-text="Screenshot showing how to view streaming logs in the portal.":::
0 commit comments