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
title: Diagnostic Logging for Azure Cognitive Services
3
3
titleSuffix: Cognitive Services - Azure
4
4
description: This guide provides step-by-step instructions to enable diagnostic logging for an Azure Cognitive Service. These logs provide rich, frequent data about the operation of a resource that are used for issue identification and debugging.
5
5
services: cognitive-services
6
6
author: erhopf
7
7
manager: cgronlun
8
8
ms.service: cognitive-services
9
9
ms.topic: article
10
-
ms.date: 10/10/2018
10
+
ms.date: 06/14/2019
11
11
ms.author: erhopf
12
12
---
13
13
14
14
# Enable diagnostic Logging for Azure Cognitive Services
15
15
16
-
This guide provides step-by-step instructions to enable diagnostic logging for an Azure Cognitive Service. These logs provide rich, frequent data about the operation of a resource that are used for issue identification and debugging. Before you continue, you must have an Azure account with a subscription to at least one Cognitive Service, such as [Bing Web Search](), [Computer Vision](), or [LUIS]().
16
+
This guide provides step-by-step instructions to enable diagnostic logging for an Azure Cognitive Service. These logs provide rich, frequent data about the operation of a resource that are used for issue identification and debugging. Before you continue, you must have an Azure account with a subscription to at least one Cognitive Service, such as [Bing Web Search](https://docs.microsoft.com/azure/cognitive-services/bing-web-search/overview), [Speech Services](https://docs.microsoft.com/azure/cognitive-services/speech-service/overview), or [LUIS](https://docs.microsoft.com/azure/cognitive-services/luis/what-is-luis).
17
17
18
18
## Prerequisites
19
19
@@ -23,14 +23,14 @@ To enable diagnostic logging, you'll need somewhere to store your log data. This
23
23
*[Log Analytics](https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitor-stream-diagnostic-logs-log-analytics) - A flexible log search and analytics tool that allows for analysis of raw logs generated by an Azure resource.
24
24
25
25
> [!NOTE]
26
-
> Additional configuration options are available. To learn more, see [Collect and consume log data from your Azure resources](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-of-diagnostic-logs).
26
+
> Additional configuration options are available. To learn more, see [Collect and consume log data from your Azure resources](https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-overview-of-diagnostic-logs).
27
27
28
28
## Enable diagnostic log collection
29
29
30
30
Let's start by enabling diagnostic logging using the Azure portal.
31
31
32
32
> [!NOTE]
33
-
> To enable this feature using PowerShell or the Azure CLI, use the instructions provided in [Collect and consume log data from your Azure resources](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-of-diagnostic-logs#how-to-enable-collection-of-diagnostic-logs).
33
+
> To enable this feature using PowerShell or the Azure CLI, use the instructions provided in [Collect and consume log data from your Azure resources](https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-overview-of-diagnostic-logs#how-to-enable-collection-of-diagnostic-logs).
34
34
35
35
1. Navigate to the Azure portal. Then locate and select a Cognitive Services resource. For example, your subscription to Bing Web Search.
36
36
2. Next, from the left-hand navigation menu, locate **Monitoring** and select **Diagnostic settings**. This screen contains all previously created diagnostic settings for this resource.
@@ -51,30 +51,46 @@ Azure Storage is a robust object storage solution that is optimized for storing
51
51
3. Use the available drop-downs to configure your query. For this example, let's set the time range to **Last 30 days** and the metric to **Transaction**.
52
52
4. When the query is complete, you'll see a visualization of transaction over the last 30 days. To export this data, use the **Export to Excel** button located at the top of the page.
53
53
54
-
Learn more about what you can do with diagnostic data in [Azure Storage](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction).
54
+
Learn more about what you can do with diagnostic data in [Azure Storage](https://docs.microsoft.com/azure/storage/blobs/storage-blobs-introduction).
55
55
56
56
## View logs in Log Analytics
57
57
58
-
<Someintro>
58
+
Follow these instructions to explore log analytics data for your resource.
59
59
60
60
1. From the Azure Portal, locate and select **Log Analytics** from the left-hand navigation menu.
61
61
2. Locate and select the resource you created when enabling diagnostics.
62
62
3. Under **General**, locate and select **Logs**. From this page, you can run queries against your logs.
63
63
64
64
### Sample queries
65
65
66
-
Now that you've enabled data collection, run this query to see the 10 most recent logs:
66
+
Run this query for all diagnostic logs from Azure Cognitivie Services for a specified time period:
67
67
68
+
```kusto
69
+
AzureDiagnostics
70
+
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
68
71
```
69
-
AzureDiagnostics | take 10
70
-
```
71
72
72
-
<-! Work with Greg to add additional queries ->
73
+
Run this query to see the 10 most recent logs:
74
+
75
+
```kusto
76
+
AzureDiagnostics
77
+
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
78
+
| take 10
79
+
```
73
80
74
-
## Set an alert
81
+
Run this query to group operations by **Resource**:
75
82
76
-
<-! Work with Greg to provide context for alerts. ->
83
+
```kusto
84
+
AzureDiagnostics
85
+
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES" |
86
+
summarize count() by Resource
87
+
```
77
88
78
-
## Schema
89
+
## Next steps
79
90
80
-
<-! Work with Greg to complete the JSON schema. ->
91
+
* To understand how to enable logging, and also the metrics and log categories that are supported by the various Azure services, read both the [Overview of metrics](https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-overview-metrics) in Microsoft Azure and [Overview of Azure Diagnostic Logs](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-logs-overview) articles.
92
+
* Read these articles to learn about event hubs:
93
+
*[What is Azure Event Hubs?](https://docs.microsoft.com/azure/event-hubs/event-hubs-what-is-event-hubs)
94
+
*[Get started with Event Hubs](https://docs.microsoft.com/azure/event-hubs/event-hubs-csharp-ephcs-getstarted)
95
+
* Read [Download metrics and diagnostic logs from Azure Storage](https://docs.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-dotnet#download-blobs).
96
+
* Read [Understand log searches in Azure Monitor logs](https://docs.microsoft.com/azure/log-analytics/log-analytics-log-search-new).
0 commit comments