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: Azure Event Grid - Enable diagnostic logs for a topic
2
+
title: Azure Event Grid - Enable diagnostic logs for topics or domains
3
3
description: This article provides step-by-step instructions on how to enable diagnostic logs for an Azure event grid topic.
4
4
services: event-grid
5
5
author: spelluru
6
6
7
7
ms.service: event-grid
8
8
ms.topic: how-to
9
-
ms.date: 01/30/2020
9
+
ms.date: 04/27/2020
10
10
ms.author: spelluru
11
11
---
12
12
13
-
# Diagnostic logs for an Azure event grid topic
14
-
Diagnostic settings allow Event Grid users to capture and view publish and delivery failure Logs in one of the following places: an Azure storage account, an event hub, or a Log Analytics workspace. This article provides step-by-step instructions to enable diagnostic logs for an event grid topic.
13
+
# Enable Diagnostic logs for Azure event grid topics or domains
14
+
Diagnostic Settings now allow Event Grid users to capture and view **publish and delivery failure** Logs in either a Storage account, an event hub, or a Log Analytics Workspace. This article provides step-by-step instructions to enable these settings on an Event Grid Topic.
15
15
16
16
## Prerequisites
17
17
18
18
- A provisioned event grid topic
19
-
- A provisioned destination for capturing diagnostic logs. It can one of the following destinations:
19
+
- A provisioned destination for capturing diagnostic logs. It can one of the following destinations in the same location as the event grid topic:
20
20
- Azure storage account
21
21
- Event hub
22
22
- Log Analytics workspace
23
23
24
-
25
24
## Steps for enabling diagnostic logs for a topic
26
25
26
+
> [!NOTE]
27
+
> The following procedure provides step-by-step instructions for enabling diagnostic logs for a topic. Steps for enabling diagnostic logs for a domain are very similar. In step 2, navigate to the event grid **domain** in the Azure portal.
28
+
27
29
1. Sign in to the [Azure portal](https://portal.azure.com).
28
30
2. Navigate to the event grid topic for which you want to enable diagnostic log settings.
29
31
3. Select **Diagnostic settings** under **Monitoring** in the left menu.
30
32
4. On the **Diagnostic settings** page, select **Add New Diagnostic Setting**.
7. Select the **DeliveryFailures** and **PublishFailures** options in the **Log** section.
37
+

36
38
6. Enable one or more of the capture destinations for the logs, and then configure them by selecting a previous created capture resource.
37
39
- If you select **Archive to a storage account**, select **Storage account - Configure**, and then select the storage account in your Azure subscription.
38
40
@@ -41,13 +43,43 @@ Diagnostic settings allow Event Grid users to capture and view publish and deliv
41
43

42
44
- If you select **Send to Log Analytics**, select the Log Analytics workspace.
43
45

44
-
7. Select the **DeliveryFailures** and **PublishFailures** options in the **Log** section.
45
-

46
-
8. Select **Save**. Select **X** in the right-corner to close the page.
46
+
8. Select **Save**. Then, select **X** in the right-corner to close the page.
47
47
9. Now, back on the **Diagnostic settings** page, confirm that you see a new entry in the **Diagnostics Settings** table.
48
48

49
49
50
50
You can also enable collection of all metrics for the topic.
51
51
52
+
## View diagnostic logs in Azure Storage
53
+
54
+
1. Once you enable a storage account as a capture destination and Event Grid starts emitting diagnostic logs, you should see new containers named **insights-logs-deliveryfailures** and **insights-logs-publishfailures** in the storage account.
55
+
56
+

57
+
2. As you navigate through one of the containers, you will end up at a blob in JSON format. The file contains log entries for either a delivery failure or a publish failure. The navigation path represents the **ResourceId** of the event grid topic and the timestamp (minute level) as to when the log entries were emitted. The blob/JSON file, which is downloadable, in the end adheres to the schema described in the next section.
58
+
59
+
[](./media/enable-diagnostic-logs-topic/select-json.png)
60
+
3. You should see content in the JSON file similar to the following example:
| Time | DateTime | The time when the log entry was generated <p>**Example value:** 01-29-2020 09:52:02.700</p> |
78
+
| EventSubscriptionName | String | The name of the event subscription <p>**Example value:** "EVENTSUB1"</p> <p>This property exists only for delivery failure logs.</p> |
79
+
| Category | String | The log category name. <p>**Example values:** "DeliveryFailures" or "PublishFailures" |
80
+
| OperationName | String | The name of the operation performed while encountering the failure.<p>**Example Values:** "Deliver" for delivery failures. |
81
+
| Message | String | The log message for the user explaining the reason for the failure and other additional details. |
82
+
| ResourceId | String | The resource ID for the topic/domain resource<p>**Example Values:** `/SUBSCRIPTIONS/SAMPLE-SUBSCRIPTION-ID/RESOURCEGROUPS/SAMPLE-RESOURCEGROUP/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/TOPIC1` |
83
+
52
84
## Next steps
53
-
If you need more help, post your issue in the [Stack Overflow forum](https://stackoverflow.com/questions/tagged/azure-eventgrid) or open a [support ticket](https://azure.microsoft.com/support/options/).
85
+
See the following article: [Create diagnostic setting to collect resource logs and metrics in Azure](../azure-monitor/platform/diagnostic-settings.md)
0 commit comments