Skip to main content
TrueFoundry AI Gateway allows you to control which requests are logged.

Controlling Request Logging

Using HTTP Headers

Include the X-TFY-LOGGING-CONFIG header on a request with a stringified JSON value. Set enabled to true to log the request or false to skip logging:
Note that the value of X-TFY-LOGGING-CONFIG is a stringified JSON, not a raw JSON object. Most SDKs serialize headers as strings, so wrap the JSON in quotes as shown above.

Using Global Settings

You can also control logging behavior globally using AI Gateway global settings:
In the AI Gateway UI, click Settings in the left sidebar to open global settings.

Viewing Request Logs

You can view all logged requests in the TrueFoundry UI. Go to AI Gateway > Monitor > Requests

Request logs in the Monitor section

Data Access Rules for Request Logs and Metrics

Please refer to Data Access Rules for Traces and Metrics for more information.