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
Copy file name to clipboardExpand all lines: articles/api-management/api-management-advanced-policies.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ This topic provides a reference for the following API Management policies. For i
34
34
-[Set request method](#SetRequestMethod) - Allows you to change the HTTP method for a request.
35
35
-[Set status code](#SetStatus) - Changes the HTTP status code to the specified value.
36
36
-[Set variable](api-management-advanced-policies.md#set-variable) - Persists a value in a named [context](api-management-policy-expressions.md#ContextVariables) variable for later access.
37
-
-[Trace](#Trace) - Adds a string into the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output.
37
+
-[Trace](#Trace) - Adds custom traces into the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output, Application Insights telemetries, and Diagnostic Logs.
38
38
-[Wait](#Wait) - Waits for enclosed [Send request](api-management-advanced-policies.md#SendRequest), [Get value from cache](api-management-caching-policies.md#GetFromCacheByKey), or [Control flow](api-management-advanced-policies.md#choose) policies to complete before proceeding.
39
39
40
40
## <aname="choose"></a> Control flow
@@ -909,29 +909,49 @@ Expressions used in the `set-variable` policy must return one of the following b
909
909
910
910
## <aname="Trace"></a> Trace
911
911
912
-
The `trace` policy adds a string into the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output. The policy will execute only when tracing is triggered, i.e. `Ocp-Apim-Trace` request header is present and set to `true` and `Ocp-Apim-Subscription-Key` request header is present and holds a valid key associated with the admin account.
912
+
The `trace` policy adds a custom trace into the API Inspector output, Application Insights telemetries, and/or Diagnostic Logs.
913
+
914
+
* The policy adds a custom trace to the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output when tracing is triggered, i.e. `Ocp-Apim-Trace` request header is present and set to true and `Ocp-Apim-Subscription-Key` request header is present and holds a valid key that allows tracing.
915
+
* The policy creates a [Trace](https://docs.microsoft.com/azure/azure-monitor/app/data-model-trace-telemetry) telemetry in Application Insights, when [Application Insights integration](https://docs.microsoft.com/azure/api-management/api-management-howto-app-insights) is enabled and the `severity` level specified in the policy is at or higher than the `verbosity` level specified in the diagnostic setting.
916
+
* The policy adds a property in the log entry when [Diagnostic Logs](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-use-azure-monitor#diagnostic-logs) is enabled and the severity level specified in the policy is at or higher than the verbosity level specified in the diagnostic setting.
| message | A string or expression to be logged. | Yes |
945
+
| metadata | Adds a custom property to the Application Insights [Trace](https://docs.microsoft.com/en-us/azure/azure-monitor/app/data-model-trace-telemetry) telemetry. | No |
| source | String literal meaningful to the trace viewer and specifying the source of the message. | Yes | N/A |
952
+
| severity | Specifies the severity level of the trace. Allowed values are `verbose`, `information`, `error` (from lowest to highest). | No | Verbose |
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-app-insights.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,8 @@ Before you can use Azure Application Insights, you first need to create an insta
75
75
| Sampling (%) | decimal | Values from 0 to 100 (percent). <br/> Specifies what percentage of requests will be logged to Azure Application Insights. 0% sampling means zero requests logged, while 100% sampling means all requests logged. <br/> This setting is used for reducing performance implications of logging requests to Azure Application Insights (see the section below). |
76
76
| Always log errors | boolean | If this setting is selected, all failures will be logged to Azure Application Insights, regardless of the **Sampling** setting. |
77
77
| Basic Options: Headers | list | Specifies the headers that will be logged to Azure Application Insights for requests and responses. Default: no headers are logged. |
78
-
| Basic Options: First bytes of body | integer | Specifies how many first bytes of the body are logged to Azure Application Insights for requests and responses. Default: body is not logged. |
78
+
| Basic Options: First bytes of body | integer | Specifies how many first bytes of the body are logged to Azure Application Insights for requests and responses. Default: body is not logged. |
79
+
| Advanced Options: Verbosity || Specifies the verbosity level. Only custom traces with higher severity level will be logged. Default: Information. |
79
80
| Advanced Options: Frontend Request || Specifies whether and how *frontend requests* will be logged to Azure Application Insights. *Frontend request* is a request incoming to the Azure API Management service. |
80
81
| Advanced Options: Frontend Response || Specifies whether and how *frontend responses* will be logged to Azure Application Insights. *Frontend response* is a response outgoing from the Azure API Management service. |
81
82
| Advanced Options: Backend Request || Specifies whether and how *backend requests* will be logged to Azure Application Insights. *Backend request* is a request outgoing from the Azure API Management service. |
Copy file name to clipboardExpand all lines: articles/api-management/api-management-policies.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ This section provides a reference for the following API Management policies. For
45
45
-[Set variable](api-management-advanced-policies.md#set-variable) - Persist a value in a named context variable for later access.
46
46
-[Set request method](api-management-advanced-policies.md#SetRequestMethod) - Allows you to change the HTTP method for a request.
47
47
-[Set status code](api-management-advanced-policies.md#SetStatus) - Changes the HTTP status code to the specified value.
48
-
-[Trace](api-management-advanced-policies.md#Trace) - Adds a string into the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output.
48
+
-[Trace](api-management-advanced-policies.md#Trace) - Adds custom traces into the [API Inspector](https://azure.microsoft.com/documentation/articles/api-management-howto-api-inspector/) output, Application Insights telemetries, and Diagnostic Logs.
49
49
-[Wait](api-management-advanced-policies.md#Wait) - Waits for enclosed [Send request](api-management-advanced-policies.md#SendRequest), [Get value from cache](api-management-caching-policies.md#GetFromCacheByKey), or [Control flow](api-management-advanced-policies.md#choose) policies to complete before proceeding.
0 commit comments