|
| 1 | +--- |
| 2 | +title: Enable usage logs - Developer portal - Azure API Management |
| 3 | +description: Enable logs to monitor usage of the developer portal in Azure API Management. Usage data includes views of API and product details. |
| 4 | +services: api-management |
| 5 | +author: dlepow |
| 6 | + |
| 7 | +ms.service: api-management |
| 8 | +ms.custom: |
| 9 | +ms.topic: how-to |
| 10 | +ms.date: 05/23/2024 |
| 11 | +ms.author: danlep |
| 12 | +--- |
| 13 | + |
| 14 | +# Enable logging of developer portal usage in Azure API Management |
| 15 | + |
| 16 | +[!INCLUDE [api-management-availability-premium-dev-standard-basic](../../includes/api-management-availability-premium-dev-standard-basic.md)] |
| 17 | + |
| 18 | +This article shows you how to enable Azure Monitor logs for auditing and troubleshooting usage of the API Management [developer portal](developer-portal-overview.md). When enabled through a diagnostic setting, the logs collect information about the requests that are received and processed by the developer portal. |
| 19 | + |
| 20 | +Developer portal usage logs include data about activity in the developer portal, including: |
| 21 | + |
| 22 | +* User authentication actions, such as sign-in and sign-out |
| 23 | +* Views of API details, API operation details, and products |
| 24 | +* API testing in the interactive test console |
| 25 | + |
| 26 | +> [!NOTE] |
| 27 | +> Developer portal usage logs in API Management are currently in preview. |
| 28 | +
|
| 29 | +## Enable diagnostic setting for developer portal logs |
| 30 | + |
| 31 | +To configure a diagnostic setting for developer portal usage logs: |
| 32 | + |
| 33 | +1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance. |
| 34 | +1. In the left menu, under **Monitoring**, select **Diagnostic settings** > **+ Add diagnostic setting**. |
| 35 | + |
| 36 | + :::image type="content" source="media/developer-portal-enable-usage-logs/monitoring-menu.png" alt-text="Screenshot of adding a diagnostic setting in the portal."::: |
| 37 | +1. On the **Diagnostic setting** blade, enter or select details for the setting: |
| 38 | + 1. **Diagnostic setting name**: Enter a descriptive name. |
| 39 | + 1. **Category groups**: Optionally make a selection for your scenario. |
| 40 | + 1. Under **Categories**: Select **Logs related to Developer Portal usage**. Optionally select other categories as needed. |
| 41 | + 1. Under **Destination details**, select one or more options and specify details for the destination. For example, archive logs to a storage account or stream them to an event hub. [Learn more](../azure-monitor/essentials/diagnostic-settings.md) |
| 42 | + > [!NOTE] |
| 43 | + > Currently, the **Send to Log Analytics workspace** destination isn't supported for developer portal usage logs. |
| 44 | +
|
| 45 | + 1. Select **Save**. |
| 46 | + |
| 47 | +## View diagnostic log data |
| 48 | + |
| 49 | +Depending on the log destination you choose, it can take a few minutes for data to appear. |
| 50 | + |
| 51 | +If you send logs to a storage account, you can access the data in the Azure portal and download it for analysis. |
| 52 | + |
| 53 | +1. In the [Azure portal](https://portal.azure.com), navigate to the storage account destination. |
| 54 | +1. In the left menu, select **Storage Browser**. |
| 55 | +1. Under **Blob containers**, select **insights-logs-developerportalauditlogs**. |
| 56 | +1. Navigate to the container for the logs in your API Management instance. The logs are partitioned in intervals of 1 hour. |
| 57 | +1. To retrieve the data for further analysis, select **Download**. |
| 58 | + |
| 59 | + |
| 60 | +## Related content |
| 61 | + |
| 62 | +* [Overview of log queries in Azure Monitor](../azure-monitor/logs/log-query-overview.md). |
| 63 | + |
| 64 | +* [Developer portal audit log schema reference](developer-portal-audit-log-schema-reference.md). |
| 65 | + |
0 commit comments