Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 7.03 KB

diagnostic-logs-reference.md

File metadata and controls

49 lines (38 loc) · 7.03 KB
titledescriptionservicesauthorms.servicems.topicms.datems.authorms.custom
Diagnostic logs settings reference | Azure API Management
Reference for settings to define the API data collected from Azure API Management and sent to Azure Monitor logs or Application Insights.
api-management
dlepow
azure-api-management
reference
05/15/2024
danlep
engagement-fy23

Diagnostics logs settings reference: API Management

[!INCLUDE api-management-availability-all-tiers]

This reference describes settings for API diagnostics logging from an API Management instance. To enable logging of API requests, see the following guidance:

Note

Certain settings, where noted, apply only to logging to Application Insights.

SettingTypeDescription
EnablebooleanSpecifies whether logging of this API is enabled.

Logging can be enabled for all APIs or for an individual API. Settings for an individual API override settings for all APIs, if enabled.
DestinationAzure Application Insights loggerSpecifies logger to be used for Application Insights logging.
Sampling (%)decimalValues from 0 to 100 (percent).
Specifies the percentage of requests that are logged. 0% sampling means zero requests logged, while 100% sampling means all requests logged. Default: 100

For performance impacts of Application Insights logging, see Performance implications and log sampling.
Always log errorsbooleanIf this setting is enabled, all failures are logged, regardless of the Sampling setting.
Log client IP addressbooleanIf this setting is enabled, the client IP address for API requests is logged.
VerbositySpecifies the verbosity of the logs and whether custom traces that are configured in trace policies are logged.

* Error - failed requests, and custom traces of severity error
* Information - failed and successful requests, and custom traces of severity error and information
* Verbose - failed and successful requests, and custom traces of severity error, information, and verbose

Default: Information
Correlation protocolSpecifies the protocol used to correlate telemetry sent by multiple components to Application Insights. Default: Legacy

For information, see Telemetry correlation in Application Insights.
Headers to loglistSpecifies the headers that are logged for requests and responses. Default: no headers are logged.
Number of payload (body) bytes to logintegerSpecifies the number of initial bytes of the frontend or backend request or response body that are logged. Maximum: 8,192. Default: 0
Frontend RequestSpecifies whether and how frontend requests (requests incoming to the API Management gateway) are logged.

If this setting is enabled, specify Headers to log, Number of payload bytes to log, or both.
Frontend ResponseSpecifies whether and how frontend responses (responses outgoing from the API Management gateway) are logged.

If this setting is enabled, specify Headers to log, Number of payload bytes to log, or both.
Backend RequestSpecifies whether and how backend requests (requests outgoing from the API Management gateway) are logged.

If this setting is enabled, specify Headers to log, Number of payload bytes to log, or both.
Backend ResponseSpecifies whether and how backend responses (responses incoming to the API Management gateway) are logged.

If this setting is enabled, specify Headers to log, Number of payload bytes to log, or both.

[!INCLUDE api-management-log-entry-size-limit]

Related content

  • For more information, see the reference for the Diagnostic entity in the API Management REST API.
  • Use the trace policy to add custom traces to Application Insights telemetry, resource logs, or request tracing.
close