You can capture the current message state at any point in the API Proxy message pipeline and send it to selected connectors. This policy enables mid-pipeline snapshot logging across HTTP, WebSocket, and gRPC protocols.
This document describes the detailed usage of a specific policy. If you are using the Apinizer policy structure for the first time or want to learn the general operating principles of policies, we recommend reading the What is Policy? page first.
The Log Policy captures a snapshot of the current message state at any point in the message processing pipeline and sends it to designated connectors.
Unlike standard traffic logging, it enables logging at intermediate points in the pipeline (e.g., before and after a transformation policy) to track message changes.
Sync/Async Execution: In synchronous mode, the pipeline waits until delivery is complete; in asynchronous mode, the pipeline continues while delivery happens in the background.
Multi-Protocol Support: Works across HTTP, WebSocket, and gRPC protocols.
Multi-Connector Delivery: The same snapshot can be sent to multiple connectors.
Field-Level Control: Headers, parameters, body, metadata, and metrics can each be independently enabled or disabled.
Body Size Limiting: Body data can be logged fully or partially. In partial mode, a maximum size can be specified.
Policy-Level Privacy: Masking, deletion, hashing, or encryption can be applied to sensitive data.
Condition-Based Execution: Define conditions to ensure the policy only runs in specific situations.
You can select the connectors to which the policy will send logs. Connectors are selected through connection definitions and work independently of environments — the same connection definition may correspond to different connector instances in different environments.
A log policy defined as a global policy works across all environments. In each environment, the connector corresponding to the relevant connection definition is automatically matched.
You can configure privacy settings at the policy level to process sensitive data before it is written to the log record.
Operation
Description
Mask
Partially hides sensitive data (e.g., ****1234)
Delete
Completely removes sensitive data
Hash
Converts sensitive data to a one-way hash value
Encrypt
Encrypts sensitive data
Privacy settings are applied at two levels: first the policy-level settings, then the connector-level settings. If both levels are enabled, both are applied in sequence.
In synchronous mode, a connector error breaks the pipeline and returns an error to the client. If uninterrupted operation is required in production, prefer asynchronous mode.
In asynchronous mode, when a connector error occurs, the error information is written to application logs, but the client request is not affected.