Azure APIM - Log All request and response headers

Nagashree Balasundaram 731 Reputation points

Is there a way to log all the request and response headers in Azure APIM for all APIs? (at a global level)

Specifically log req and response headers for error cases

I tried the solution posted in which is specific to each API

Do you need to list each and every header to be logged? Under "Headers to Log" section - i tried specifying a *, it doesnt seem to take effect.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,659 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 67,001 Reputation points

    @Nagashree Balasundaram Thanks for reaching out. If you want to log at the global level, then you need to specify the settings at the All API level as below.

    • Navigate to "All APIs" (or the specific API if you wish to apply the logging setting at specific API scope)
    • Click on "Settings"
    • Click "Azure Monitor"
    • Add the desired headers to 'Headers to log"
    • Save

    Any headers that are part of the incoming request can be logged in Log Analytics/Azure Monitor. Yes, you need to specify all headers that you want to be logged.
    By Default: no headers are logged and * will not work. You can refer to this document for all the supported settings and their value types.

    Feel free to get back to me if you need any assistance.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful