|
1 | 1 | ---
|
2 | 2 | # Mandatory fields.
|
3 |
| -title: Enable and query diagnostics logs |
| 3 | +title: Use diagnostics logs |
4 | 4 | titleSuffix: Azure Digital Twins
|
5 |
| -description: See how to enable logging with diagnostics settings and query the logs for immediate viewing. |
| 5 | +description: See how to enable logging with diagnostics settings and query the logs for immediate viewing. Also, learn about the log categories and their schemas. |
6 | 6 | author: baanders
|
7 | 7 | ms.author: baanders # Microsoft employees only
|
8 |
| -ms.date: 8/24/2021 |
| 8 | +ms.date: 9/15/2021 |
9 | 9 | ms.topic: how-to
|
10 | 10 | ms.service: digital-twins
|
| 11 | +ms.custom: contperf-fy22q1 |
11 | 12 | ---
|
12 | 13 |
|
13 | 14 | # Troubleshooting Azure Digital Twins: Diagnostics logging
|
14 | 15 |
|
15 |
| -Azure Digital Twins can collect logs for your service instance to monitor its performance, access, and other data. You can use these logs to get an idea of what is happening in your Azure Digital Twins instance, and analyze root causes on issues without needing to contact Azure support. |
| 16 | +Azure Digital Twins can collect **logs** for your service instance to monitor its performance, access, and other data. You can use these logs to get an idea of what is happening in your Azure Digital Twins instance, and analyze root causes on issues without needing to contact Azure support. |
16 | 17 |
|
17 |
| -This article shows you how to [configure diagnostic settings](#turn-on-diagnostic-settings) in the [Azure portal](https://portal.azure.com) to start collecting logs from your Azure Digital Twins instance. You can also specify where the logs should be stored (such as Log Analytics or a storage account of your choice). |
| 18 | +This article shows you how to configure diagnostic settings in the [Azure portal](https://portal.azure.com), including what types of logs to collect and where to store them (such as Log Analytics or a storage account of your choice). Then, you can query the logs to quickly gather custom insights. |
18 | 19 |
|
19 |
| -This article also contains lists of all [log categories](#log-categories) and [log schemas](#log-schemas) that Azure Digital Twins collects. |
20 |
| - |
21 |
| -After setting up logs, you can also [query the logs](#view-and-query-logs) to quickly gather custom insights. |
| 20 | +This article also contains information about all the **log categories** that Azure Digital Twins can collect, and their **schemas**. |
22 | 21 |
|
23 | 22 | ## Turn on diagnostic settings
|
24 | 23 |
|
@@ -55,6 +54,32 @@ New settings take effect in about 10 minutes. After that, logs appear in the con
|
55 | 54 |
|
56 | 55 | For more detailed information on diagnostic settings and their setup options, you can visit [Create diagnostic settings to send platform logs and metrics to different destinations](../azure-monitor/essentials/diagnostic-settings.md).
|
57 | 56 |
|
| 57 | +## View and query logs |
| 58 | + |
| 59 | +After configuring storage details of your Azure Digital Twins logs, you can write **custom queries** for them to generate insights and troubleshoot issues. The service also provides a few example queries that can help you get started, by addressing common questions that customers may have about their instances. |
| 60 | + |
| 61 | +Here's how to query the logs for your instance. |
| 62 | + |
| 63 | +1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Azure Digital Twins instance. You can find it by typing its name into the portal search bar. |
| 64 | + |
| 65 | +2. Select **Logs** from the menu to open the log query page. The page opens to a window called *Queries*. |
| 66 | + |
| 67 | + :::image type="content" source="media/troubleshoot-diagnostics/logs.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal with the Queries window overlaid, showing prebuilt queries." lightbox="media/troubleshoot-diagnostics/logs.png"::: |
| 68 | + |
| 69 | + These queries are prebuilt examples written for various logs. You can select one of the queries to load it into the query editor and run it to see these logs for your instance. |
| 70 | + |
| 71 | + You can also close the *Queries* window without running anything to go straight to the query editor page, where you can write or edit custom query code. |
| 72 | + |
| 73 | +3. After exiting the *Queries* window, you'll see the main query editor page. Here you can view and edit the text of the example queries, or write your own queries from scratch. |
| 74 | + :::image type="content" source="media/troubleshoot-diagnostics/logs-query.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal. It includes a list of logs, query code, and Queries History." lightbox="media/troubleshoot-diagnostics/logs-query.png"::: |
| 75 | + |
| 76 | + In the left pane, |
| 77 | + - The *Tables* tab shows the different Azure Digital Twins [log categories](#log-categories) that are available to use in your queries. |
| 78 | + - The *Queries* tab contains the example queries that you can load into the editor. |
| 79 | + - The *Filter* tab lets you customize a filtered view of the data that the query returns. |
| 80 | + |
| 81 | +For more detailed information on log queries and how to write them, you can visit [Overview of log queries in Azure Monitor](../azure-monitor/logs/log-query-overview.md). |
| 82 | + |
58 | 83 | ## Log categories
|
59 | 84 |
|
60 | 85 | Here are more details about the categories of logs that Azure Digital Twins collects.
|
@@ -335,34 +360,6 @@ Here's an example JSON body for an `ADTEventRoutesOperation` that of `Microsoft.
|
335 | 360 | },
|
336 | 361 | ```
|
337 | 362 |
|
338 |
| -## View and query logs |
339 |
| - |
340 |
| -Earlier in this article, you configured the types of logs to store and specified their storage location. |
341 |
| - |
342 |
| -To troubleshoot issue and generate insights from these logs, you can generate **custom queries**. To get started, you can also take advantage of a few example queries provided for you by the service, which address common questions that customers may have about their instance. |
343 |
| - |
344 |
| -Here's how to query the logs for your instance. |
345 |
| - |
346 |
| -1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Azure Digital Twins instance. You can find it by typing its name into the portal search bar. |
347 |
| - |
348 |
| -2. Select **Logs** from the menu to open the log query page. The page opens to a window called *Queries*. |
349 |
| - |
350 |
| - :::image type="content" source="media/troubleshoot-diagnostics/logs.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal with the Queries window overlaid, showing prebuilt queries." lightbox="media/troubleshoot-diagnostics/logs.png"::: |
351 |
| - |
352 |
| - These queries are prebuilt examples written for various logs. You can select one of the queries to load it into the query editor and run it to see these logs for your instance. |
353 |
| - |
354 |
| - You can also close the *Queries* window without running anything to go straight to the query editor page, where you can write or edit custom query code. |
355 |
| - |
356 |
| -3. After exiting the *Queries* window, you'll see the main query editor page. Here you can view and edit the text of the example queries, or write your own queries from scratch. |
357 |
| - :::image type="content" source="media/troubleshoot-diagnostics/logs-query.png" alt-text="Screenshot showing the Logs page for an Azure Digital Twins instance in the Azure portal. It includes a list of logs, query code, and Queries History." lightbox="media/troubleshoot-diagnostics/logs-query.png"::: |
358 |
| - |
359 |
| - In the left pane, |
360 |
| - - The *Tables* tab shows the different Azure Digital Twins [log categories](#log-categories) that are available to use in your queries. |
361 |
| - - The *Queries* tab contains the example queries that you can load into the editor. |
362 |
| - - The *Filter* tab lets you customize a filtered view of the data that the query returns. |
363 |
| - |
364 |
| -For more detailed information on log queries and how to write them, you can visit [Overview of log queries in Azure Monitor](../azure-monitor/logs/log-query-overview.md). |
365 |
| - |
366 | 363 | ## Next steps
|
367 | 364 |
|
368 | 365 | * For more information about configuring diagnostics, see [Collect and consume log data from your Azure resources](../azure-monitor/essentials/platform-logs-overview.md).
|
|
0 commit comments