You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cf-aig-collect-log-payload` header allows you to control whether the raw request and response bodies (payloads) are stored for a given request. Unlike `cf-aig-collect-log`, which controls the entire log entry, this header only affects payload storage — metadata such as token counts, model, provider, status code, cost, and duration will still be logged.
53
+
54
+
This is useful when you want to maintain visibility into usage metrics and request metadata without persisting sensitive prompt or completion data.
55
+
56
+
| Header value | Behavior |
57
+
| ------------ | -------- |
58
+
|`true`| Request and response payloads are stored. |
59
+
|`false`| Payload storage is skipped. Metadata-only log entries are still saved. |
60
+
61
+
In the example below, we use `cf-aig-collect-log-payload` to skip storing the request and response bodies while keeping the metadata log.
"content": "What is the email address and phone number of user123?"
74
+
}
75
+
]
76
+
}
77
+
'
78
+
```
79
+
80
+
:::note
81
+
If `cf-aig-collect-log` is set to `false`, the entire log entry (including metadata) is skipped regardless of the `cf-aig-collect-log-payload` value. Use `cf-aig-collect-log-payload: false` on its own if you only want to suppress payload storage while retaining metadata logs.
82
+
:::
83
+
50
84
## DLP fields in logs
51
85
52
86
When [Data Loss Prevention (DLP)](/ai-gateway/features/dlp/) policies are enabled on a gateway, log entries for requests that trigger a DLP policy match include additional fields:
0 commit comments