Skip to content

Commit 7e93321

Browse files
committed
Relay - Diagnostic logs
1 parent bbae25e commit 7e93321

File tree

5 files changed

+118
-1
lines changed

5 files changed

+118
-1
lines changed

articles/service-bus-relay/TOC.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@
5959
href: relay-hybrid-connections-dotnet-api-overview.md
6060
- name: Node
6161
href: relay-hybrid-connections-node-ws-api-overview.md
62-
- name: Manage
62+
- name: Manage and monitor
6363
items:
6464
- name: Monitor Azure Relay with Azure Monitoring
6565
href: relay-metrics-azure-monitor.md
66+
- name: Set up diagnostic logs
67+
href: diagnostic-logs.md
6668
- name: Reference
6769
items:
6870
- name: .NET
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: Azure Relay - diagnostics logs | Microsoft Docs
3+
description: This article provides an overview of all the operational and diagnostics logs that are available for Azure Service Bus.
4+
services: service-bus-messaging
5+
author: spelluru
6+
editor:
7+
8+
ms.assetid:
9+
ms.service: service-bus-relay
10+
ms.devlang: na
11+
ms.topic: how-to
12+
ms.tgt_pltfrm: na
13+
ms.date: 04/27/2020
14+
ms.author: spelluru
15+
16+
---
17+
# Enable diagnostics logs for Azure Relay
18+
When you start using your Azure Relay namespace, you might want to monitor how and when your namespace is created, deleted, or accessed. This article provides an overview of all the operational and diagnostics logs that are available.
19+
20+
You can view two types of logs for Azure Relay:
21+
22+
- [Activity logs](../azure-monitor/platform/platform-logs-overview.md): These logs have information about operations performed against your namespace in the Azure portal or through Azure Resource Manager template. These logs are always enabled. For example: "Create or update namespace", "Create or update hybrid connection".
23+
- [Diagnostic logs](../azure-monitor/platform/platform-logs-overview.md): You can configure diagnostic logs for a richer view of everything that happens with operations and actions that are conducted against your namespace by using the API, or through management clients on the language SDK.
24+
25+
## View activity logs
26+
To view activity logs for your Azure Relay namespace, switch to the **Activity log** page in the Azure portal.
27+
28+
![Azure Relay - activity log](./media/diagnostic-logs/activity-log.png)
29+
30+
## Enable diagnostic logs
31+
Only one category: Hybrid Connections
32+
33+
To enable diagnostics logs, do the following:
34+
35+
1. In the [Azure portal](https://portal.azure.com), go to your Azure Relay namespace and then, under **Monitoring**, select **Diagnostic settings**.
36+
1. On the **Diagnostics settings** page, select **Add diagnostic setting**.
37+
38+
![The "Add diagnostic setting" link](./media/diagnostic-logs/add-diagnostic-setting.png)
39+
40+
1. Configure the diagnostics settings by doing the following:
41+
1. In the **Name** box, enter a name for the diagnostics settings.
42+
2. Select **HybridConnectionsEvent** for the type of log. It's the only type supported.
43+
3. Select one of the following three **destinations** for your diagnostics logs:
44+
1. If you select **Archive to a storage account**, configure the storage account where the diagnostics logs will be stored.
45+
2. If you select **Stream to an event hub**, configure the event hub that you want to stream the diagnostics logs to.
46+
3. If you select **Send to Log Analytics**, specify which instance of Log Analytics the diagnostics will be sent to.
47+
48+
![Sample diagnostic settings](./media/diagnostic-logs/sample-diagnostic-settings.png)
49+
1. Select **Save** on the toolbar to save the settings.
50+
51+
The new settings take effect in about 10 minutes. The logs are displayed in the configured archival target, in the **Diagnostics logs** pane. For more information about configuring diagnostics settings, see the [overview of Azure diagnostics logs](../azure-monitor/platform/diagnostic-logs-overview.md).
52+
53+
54+
## Schema for hybrid connections events
55+
Hybrid connections event log JSON strings include the elements listed in the following table:
56+
57+
| Name | Description |
58+
| ------- | ------- |
59+
| ResourceId | Azure Resource Manager resource ID |
60+
| ActivityId | Internal ID, used to identify the specified operation. May also be known as "TrackingId" |
61+
| Endpoint | The address of the Relay resource |
62+
| OperationName | The type of the HybridConnection operation that’s  being logged |
63+
| EventTimeString | The UTC timestamp of the log record |
64+
| Message | The detailed message of the event |
65+
| Category | Category of the event. Currently, it's only `HybridConnectionsEvents`.
66+
67+
68+
## Sample hybrid connections event
69+
Here's a sample hybrid connections event in JSON format.
70+
71+
```json
72+
{
73+
"resourceId": "/SUBSCRIPTIONS/0000000000-0000-0000-0000-0000000000000/RESOURCEGROUPS/MyResourceGroup/PROVIDERS/MICROSOFT.RELAY/NAMESPACES/MyRelayNamespace",
74+
"ActivityId": "7006a0db-27eb-445c-939b-ce86133014cc",
75+
"endpoint": "sb://myrelayns.servicebus.windows.net/mhybridconnection/7006a0db-27eb-445c-939b-ce86133014cc_G5",
76+
"operationName": "Microsoft.Relay/HybridConnections/NewSenderRegistering",
77+
"EventTimeString": "2020-04-27T20:27:57.3842810Z",
78+
"message": "A new on-premises sender is registering.",
79+
"category": "HybridConnectionsEvent"
80+
}
81+
```
82+
83+
## Events and operations captured in diagnostic logs
84+
85+
| Operation | Description |
86+
| --------- | ----------- |
87+
| AuthorizationFailed | |
88+
| InvalidSasToken | |
89+
| ListenerAcceptingConnection | |
90+
| ListenerAcceptingConnectionTimeout | |
91+
| ListenerAcceptingHttpRequestFailed | |
92+
| ListenerAcceptingRequestTimeout | |  
93+
| ListenerClosingFromExpiredToken | | 
94+
| ListenerRejectedConnection | |
95+
| ListenerReturningHttpResponse | |  
96+
| ListenerReturningHttpResponseFailed | |
97+
ListenerSentHttpResponse" | |
98+
| ListenerUnregistered | |
99+
| ListenerUnresponsive | |
100+
| MessageSendingToOnPremListener | |
101+
| MessageSentToOnPremListener | |
102+
| NewListenerRegistered | |
103+
| NewSenderRegistering | |
104+
| ProcessingRequestFailed | |
105+
| SenderConnectionClosed | |
106+
| SenderListenerConnectionEstablished | |
107+
| SenderSentHttpRequest | |
108+
109+
110+
## Next steps
111+
112+
To learn more about Service Bus, see:
113+
114+
* [Introduction to Service Bus](service-bus-messaging-overview.md)
115+
* [Get started with Service Bus](service-bus-dotnet-get-started-with-queues.md)
62.2 KB
Loading
78.6 KB
Loading
76.7 KB
Loading

0 commit comments

Comments
 (0)