Skip to content

Commit 87afb6c

Browse files
authored
Merge pull request #275506 from dlepow/trunc
[APIM] Log entry limit
2 parents f429d72 + d61d86b commit 87afb6c

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

articles/api-management/api-management-howto-use-azure-monitor.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: dlepow
77
ms.service: api-management
88
ms.custom: engagement-fy23, devdivchpfy22
99
ms.topic: tutorial
10-
ms.date: 06/27/2023
10+
ms.date: 05/15/2024
1111
ms.author: danlep
1212
---
1313
# Tutorial: Monitor published APIs
@@ -179,7 +179,7 @@ For more information about using resource logs for API Management, see:
179179
180180
## Modify API logging settings
181181
182-
By default, when you create a diagnostic setting to enable collection of resource logs, logging is enabled for all APIs, with default settings. You can adjust the logging settings for all APIs, or override them for individual APIs. For example, adjust the sampling rate or the verbosity of the data, or disable logging for some APIs.
182+
By default, when you create a diagnostic setting to enable collection of resource logs, logging is enabled for all APIs, with default settings. You can adjust the logging settings for all APIs, or override them for individual APIs. For example, adjust the sampling rate or the verbosity of the data, enable logging of headers or request or response payloads, or disable logging for some APIs.
183183
184184
For details about the logging settings, see [Diagnostic logging settings reference](diagnostic-logs-reference.md).
185185
@@ -188,14 +188,16 @@ To configure logging settings for all APIs:
188188
1. In the left menu of your API Management instance, select **APIs** > **All APIs**.
189189
1. Select the **Settings** tab from the top bar.
190190
1. Scroll down to the **Diagnostic Logs** section, and select the **Azure Monitor** tab.
191-
1. Review the settings and make changes if needed. Select **Save**.
191+
1. Review the settings and make changes if needed. Select **Save**.
192192
193193
To configure logging settings for a specific API:
194194
195195
1. In the left menu of your API Management instance, select **APIs** and then the name of the API.
196196
1. Select the **Settings** tab from the top bar.
197197
1. Scroll down to the **Diagnostic Logs** section, and select the **Azure Monitor** tab.
198-
1. Review the settings and make changes if needed. Select **Save**.
198+
1. Review the settings and make changes if needed. Select **Save**.
199+
200+
[!INCLUDE [api-management-log-entry-size-limit](../../includes/api-management-log-entry-size-limit.md)]
199201
200202
## Next steps
201203

articles/api-management/diagnostic-logs-reference.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: api-management
88
ms.topic: reference
9-
ms.date: 11/18/2022
9+
ms.date: 05/15/2024
1010
ms.author: danlep
1111
ms.custom: engagement-fy23
1212
---
@@ -35,11 +35,13 @@ This reference describes settings for API diagnostics logging from an API Manage
3535
| Verbosity | | Specifies the verbosity of the logs and whether custom traces that are configured in [trace](trace-policy.md) policies are logged. <br/><br/>* Error - failed requests, and custom traces of severity `error`<br/>* Information - failed and successful requests, and custom traces of severity `error` and `information`<br/> * Verbose - failed and successful requests, and custom traces of severity `error`, `information`, and `verbose`<br/><br/>Default: Information |
3636
| Correlation protocol | | Specifies the protocol used to correlate telemetry sent by multiple components to Application Insights. Default: Legacy <br/><br/>For information, see [Telemetry correlation in Application Insights](../azure-monitor/app/distributed-tracing-telemetry-correlation.md). |
3737
| Headers to log | list | Specifies the headers that are logged for requests and responses. Default: no headers are logged. |
38-
| Number of payload bytes to log | integer | Specifies the number of initial bytes of the body that are logged for requests and responses. Maximum: 8,192. Default: 0 |
38+
| Number of payload (body) bytes to log| integer | Specifies the number of initial bytes of the frontend or backend request or response body that are logged. Maximum: 8,192. Default: 0 |
3939
| Frontend Request | | Specifies whether and how *frontend requests* (requests incoming to the API Management gateway) are logged.<br/><br/> If this setting is enabled, specify **Headers to log**, **Number of payload bytes to log**, or both. |
4040
| Frontend Response | | Specifies whether and how *frontend responses* (responses outgoing from the API Management gateway) are logged.<br/><br/> If this setting is enabled, specify **Headers to log**, **Number of payload bytes to log**, or both. |
4141
| Backend Request | | Specifies whether and how *backend requests* (requests outgoing from the API Management gateway) are logged.<br/><br/> If this setting is enabled, specify **Headers to log**, **Number of payload bytes to log**, or both. |
42-
| Backend Response | | Specifies whether and how *backend responses* (responses incoming to the API Management gateway) are logged. <br/><br/> If this setting is enabled, specify **Headers to log**, **Number of payload bytes to log**, or both.
42+
| Backend Response | | Specifies whether and how *backend responses* (responses incoming to the API Management gateway) are logged. <br/><br/> If this setting is enabled, specify **Headers to log**, **Number of payload bytes to log**, or both.
43+
44+
[!INCLUDE [api-management-log-entry-size-limit](../../includes/api-management-log-entry-size-limit.md)]
4345

4446
## Next steps
4547

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: dlepow
3+
ms.service: api-management
4+
ms.topic: include
5+
ms.date: 05/15/2024
6+
ms.author: danlep
7+
---
8+
9+
> [!IMPORTANT]
10+
> If enabled, logged request or response payloads can be up to 8,192 bytes. API Management also enforces a 32 KB limit for a diagnostic log entry sent to Azure Monitor, which includes the payloads and other attributes such as status codes, headers, and timestamps. If the combined size of the attributes exceeds 32 KB, API Management trims the entry by removing all body and trace content.

0 commit comments

Comments
 (0)