Azure API Management Service Policy-based Logging
Section titled “ Azure API Management Service Policy-based Logging”Unlock comprehensive, policy-based logging for your Azure API Management Service APIs with Nodinite. This guide shows you how to capture every request and response—including payloads and headers—without intrusive code changes or data loss.
✅ Capture full payloads and headers for every API request and response
✅ Eliminate data loss—extract and reindex new fields anytime
✅ Apply granular retention policies by message type
✅ Integrate non-intrusively with your existing solutions
✅ Gain actionable insights and ensure compliance with ease
Why Choose Nodinite Logging Over Application Insights and Competing Solutions?
Section titled “Why Choose Nodinite Logging Over Application Insights and Competing Solutions?”In today’s fast-paced business environments, you need more than just data collection—you need actionable insights and complete context. While tools like Application Insights and other platforms require predefined logic to capture key values, Nodinite Logging removes the guesswork, prevents data loss, and gives you long-term flexibility.
Nodinite Logging vs. Application Insights & Other Competitors
Section titled “ Nodinite Logging vs. Application Insights & Other Competitors”1. Full Payload Logging—No Predefined Logic Needed
Section titled “1. Full Payload Logging—No Predefined Logic Needed”- With Nodinite, you avoid coding up-front logic to extract key values like correlation IDs, order numbers, or transaction details.
- Log all message payloads and context values in full, ensuring you always have complete visibility.
- If you forget to log a value with Application Insights or similar tools, it’s lost forever. With Nodinite, you can extract and index new fields at any time.
- Nodinite imposes no size restriction, unlike many other options.
Key Advantage: You don’t need developers to anticipate every logging requirement—log everything and extract later as needed.
2. Flexible Search & Reindexing—No More Data Loss
Section titled “2. Flexible Search & Reindexing—No More Data Loss”- Competing solutions make it too late to add a new search field after logging.
- Nodinite lets you create new search fields and reindex old data anytime, preserving historical context.
- If you extract a field incorrectly, just fix the expression and reindex—no data lost.
Key Advantage: You avoid data loss from changing business needs or mistakes in log field definitions.
3. Non-Intrusive, Policy-Based Logging
Section titled “3. Non-Intrusive, Policy-Based Logging”- Unlike Application Insights, which requires custom logging code, Nodinite uses a policy-based, non-intrusive approach.
- Log in parallel with your existing monitoring solutions—no application changes required.
Key Advantage: Achieve low performance overhead, no intrusive code changes, and full flexibility to run alongside existing tools and policies.
4. Granular, Message-Type Level Retention
Section titled “4. Granular, Message-Type Level Retention”- Competing solutions limit retention by fixed days or quotas, forcing you to choose between losing logs or paying more.
- Nodinite lets you define retention per message type, so you keep high-value transactions longer and purge less important logs earlier.
Key Advantage: Optimize retention based on business value, not arbitrary limits or storage constraints.
The Bottom Line: Why Nodinite Wins
Section titled “ The Bottom Line: Why Nodinite Wins”✅ Log everything—no upfront coding required
✅ Prevent data loss—reindex old data anytime
✅ Log large payloads—no message size limits
✅ Integrate non-intrusively—run alongside existing solutions
✅ Control retention—keep critical logs longer without extra cost
This guide presents three ways to create and send the Nodinite Log Event.
| Policy | Full payload (Body) | HTTP Headers (Context) | Monitoring |
|---|---|---|---|
| 1. Any size, Blob Storage Policy (recommended) | ✅ Yes | ✅ Yes | Azure Agent Non Events Agent |
| 2. <200KB, Event Hub Policy | ✅ Yes | ✅ Yes | Azure Agent Non Events Agent |
| 3. Direct API call Log API Policy (supported, but not recommended) | ✅ Yes | ✅ Yes | Web Services Agent Non Events Agent |
with Policy 1 - Blob Storage] --> | 1. Log Event | roBS[Blob Storage] end subgraph "Payload < 200KB" A[Azure API Management
with Policy 2 Event Hub] A --> | 2. Log Event | B(Event Hub) end subgraph "Consumption tier - API Call" AAA[Azure API Management
with Policy 3] end subgraph "Nodinite" AAA -.->|"3. Log Event (NOT our recommendation)"| F B --> C{Pickup Service} C --> F[Log API] roBS --> C end
Diagram: Policy-based logging and event flow for Azure API Management and Nodinite.
When you activate the policy (Blob Storage Policy or Event Hub Policy), the code running in Azure API Management creates a Nodinite-specific JSON Log Event and sends it to intermediate storage.
The Nodinite Pickup Log Events Service Logging Agent collects the Nodinite Log Events from the intermediate store (Event Hub or Blob Storage Container). This pattern is Asynchronous.
Log the full payload. If you use the Blob Storage Policy, message size does not matter. If it is <200KB, use the Event Hub Policy. Storing the payload in Nodinite lets you use Search Fields in Log Views to create a rich, on-demand user experience for your business.
You can change the body display using Stylesheets. This lets you hide content as needed. Use Role-based security to control who can access and view content.
Context
Section titled “Context”A Nodinite Log Event supports a Context—a collection of key-value pairs. Along with HTTP Headers, you can add properties in the Logging policy. Later, use these to create Search Fields for self-service Log Views.
| Request Headers | Response Headers |
|---|---|
![]() |
![]() |
Screenshots: Example of request and response headers captured by Nodinite logging.
If you log too much, adjust the following System Parameter:
Since you control Logging in the Policy, you determine what to include up front.
Troubleshooting
Section titled “Troubleshooting”Contact our Support if you need help implementing Logging.
Logging Options
Section titled “Logging Options”The diagram below shows the different options for logging from Azure to Nodinite.
with Serilog logging] --- | <1 MB payload | C1(Serilog Event Hub Sink) C --> | Any size | C2(Serilog Blob Storage Sink) A[Azure API Management Service API
with Policy] --- | <200 KB payload | A2(Policy2) A --- | Any size | A1(Policy1) B[Azure Logic App
with the proper diagnostic setting enabled] end subgraph "Event Hub" A2--> | 1. Nodinite JSON Log Event | AA(EH1) C1--> | 1. Nodinite JSON Log Event | AA C1 -.- | 1. Nodinite JSON Log Event | CC(EH2) B--> | 2. Azure Diagnostics log | BB(EH3) end subgraph "Azure Storage Account" A1--> | 1. Nodinite JSON Log Event | Cont(Container1) end C2 --> | 1. Nodinite JSON Log Event | Cont subgraph "Nodinite" Cont --> ro[Pickup Service] AA --> ro CC -.-> ro BB --> roLA(Logic Apps Logging and Monitoring Agent) end
Diagram: Logging options from Azure to Nodinite, including API Management, Functions, and Logic Apps.
If you log from the API policy to an Event Hub entity, you can reuse the Event Hub entity if the content is a Nodinite JSON Log Event.
- Use the Blob Storage Policy if possible for less administration and large message support.
- Logging from Azure functions can share the same Event Hub as APIM if the Log Event is a Nodinite JSON Log Event.
- Logging from Azure Logic Apps requires other event hubs as targets since the content is in a different format.
Using a shared Event Hub for a Nodinite JSON Log Event reduces administration (configure the Nodinite Pickup Log Events Service Logging Agent to fetch these events).
The disadvantage can be performance-related, or you may need to consider pricing, scalability, retention, and number of partitions.
What firewall settings are required for Azure API Management logging?
Section titled “ What firewall settings are required for Azure API Management logging?”Azure API Management opens every connection outbound; no Nodinite agent runs in Azure, and there is no Monitoring Service or Agent Server hop for logging. The policy decides the path: the Blob Storage Policy and the Event Hub Policy write to intermediate storage that the Nodinite Pickup Service reads, and the Log API Policy posts directly to the Nodinite Log API. Each arrow starts at the side that opens the connection.
Network diagram: APIM writes to Blob Storage or Event Hubs, and the Pickup Service collects the Log Events. The dashed direct Log API call is supported but not recommended.
Between Azure API Management and Azure Storage or Event Hubs
Section titled “Between Azure API Management and Azure Storage or Event Hubs”These rules matter only when you restrict APIM outbound traffic (VNet injection with a network security group or a firewall). See the Microsoft virtual network configuration reference. For Storage Accounts and Event Hubs behind their own firewall, see Network Restrictions & Alternative Solutions.
| Direction | Source | Destination | Protocol | Port(s) | Purpose | Notes |
|---|---|---|---|---|---|---|
| Outbound | Azure API Management | <account>.blob.core.windows.net |
TCP | 443 | HTTPS | Blob Storage Policy |
| Outbound | Azure API Management | <namespace>.servicebus.windows.net |
TCP | 5671, 5672, 443 | AMQP, HTTPS | Event Hub Policy; service tag EventHub |
Between Azure API Management and the Log API
Section titled “Between Azure API Management and the Log API”Required only for the Log API Policy. On Windows Server, Nodinite v7 hosts the Log API as its own IIS web site, on a port you set per environment in the Nodinite Portal (Servers step).
| Direction | Source | Destination | Protocol | Port(s) | Purpose | Notes |
|---|---|---|---|---|---|---|
| Inbound | Azure API Management | Core Services Server | TCP (HTTPS) | Log API site port | Post Log Events | Allow the APIM outbound IP addresses, or reach the Log API through your VNet |
Between the Pickup Service and Azure Storage or Event Hubs
Section titled “Between the Pickup Service and Azure Storage or Event Hubs”The Pickup Service reads the container or Event Hub and posts to the Log API; see the Pickup Service firewall settings.
Between the servers and DNS
Section titled “Between the servers and DNS”| Direction | Source | Destination | Protocol | Port(s) | Purpose | Notes |
|---|---|---|---|---|---|---|
| Outbound | Azure API Management | DNS Server | TCP/UDP | 53 | Name resolution | Only with custom DNS in a VNet; Azure DNS needs no rule |
Next Steps
Section titled “ Next Steps” Pickup Log Events Service Logging Agent
Azure Application Access
Related Topics
Section titled “ Related Topics” JSON Log Event
Managing
Monitoring
Non Events Agent
Stylesheets
Reduce Azure API Management Logging Costs
Interested in logging from other Azure Related Services?

