Controlling Logs
Two settings control logging behavior in the Cortex runtime:DISABLE_REQUEST_LOGS- When enabled, prevents logging of incoming request dataDISABLE_RESPONSE_LOGS- When enabled, prevents logging of response data from your app
These settings only affect the default Cortex runtime. If you are using a
custom runtime, you will need to
handle logging behavior in your own server implementation.
Configuration
Configure these settings as secrets at either the app or project level:- Navigate to your project dashboard
- Go to the “Secrets” section
- Add one or both of the settings as a key with a value of
"true"to disable the corresponding logs
Setting the value to anything other than
true (or leaving it undefined) will
keep logging enabled, which is the default behavior.Use Cases
Common reasons to disable logs:- Processing sensitive data: If your app processes personal or sensitive information that shouldn’t be stored in logs
- Observability optimization: For high-throughput apps where logging adds unnecessary overhead making it difficult to monitor your app
Example
To disable both request and response logging, add the following secrets to your app:| Key | Value |
|---|---|
| DISABLE_REQUEST_LOGS | true |
| DISABLE_RESPONSE_LOGS | true |
Secrets are loaded on container startup. After updating a secret, restart the
app container for the change to take effect.