ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
Monetization
Deploying & Source Control
Observability
    Logging
    Data & Security
      Akamai API SecurityAzure BlobAzure Event HubsHydrolix / Traffic Peak
    Metrics PluginsOpenTelemetryProactive monitoring
    Guides
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Data & Security

Azure Event Hubs Request Logger Plugin

This plugin pushes request/response logs to Azure Event Hubs. This can be used to stream the request data generated by your API Gateway to use for monitoring, analytics, auditing, or debugging purposes.

Enterprise Feature

Custom logging is available as an add-on as part of an enterprise plan. If you would like to purchase this feature, please contact us at sales@zuplo.com or reach out to your account manager.

Most enterprise features can be used in a trial mode for a limited time. Feel free to use enterprise features for development and testing purposes.

Setup

You can define the fields created in the JSON object by creating a custom type in TypeScript and a function to extract the field data from the Response, ZuploRequest, and ZuploContext.

The plugin is configured in the Runtime Extensions file zuplo.runtime.ts: git sta

modules/zuplo.runtime.ts
// The interface that describes the rows // in the output interface LogEntry { timestamp: string; method: string; url: string; status: number; statusText: string; sub: string | null; contentLength: string | null; } // Add the plugin runtime.addPlugin( new AzureEventHubsRequestLoggerPlugin<LogEntry>({ connectionString: environment.AZURE_EVENT_HUBS_CONNECTION_STRING, // for example "Endpoint=sb://your-namespace.servicebus.windows.net/;SharedAccessKeyName=key-name;SharedAccessKey=YOUR_SHARED_ACCESS_KEY" batchPeriodSeconds: 1, entityPath: "your-event-hub-name", generateLogEntry: (response: Response, request: ZuploRequest) => ({ // You can customize the log entry here by adding new fields timestamp: new Date().toISOString(), url: request.url, method: request.method, status: response.status, statusText: response.statusText, sub: request.user?.sub ?? null, contentLength: request.headers.get("content-length"), }), }), );

The configuration requires a connectionString which you can get from the Azure portal "Shared access policies" section in Event Hubs. If the connection string contains an EntityPath property the separate entityPath option to define the event hub's name isn't required.

Entries will be batched and sent as an array, they will be sent every batchPeriodSeconds. If not specified it will be sent very frequently (~every 10ms) to avoid data loss. Note that batchPeriodSeconds can be specified as a fraction, for example 0.1 for every 100ms.

Edit this page
Last modified on November 17, 2025
Azure BlobHydrolix / Traffic Peak
On this page
  • Setup
TypeScript