Merge pull request #24486 from BerriAI/litellm_ryan-march-23-audit-log-export

docs: add audit log export to S3 documentation
This commit is contained in:
ryan-crabbe 2026-03-23 22:54:39 -07:00 • committed by GitHub
commit 764b96b1aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,6 +56,40 @@ On the LiteLLM UI, navigate to Logs -> Audit Logs. You should see the audit log
/>
## Export Audit Logs to External Storage
You can export audit logs to an external storage backend (e.g. S3) in addition to storing them in the database. Logs are batched and uploaded asynchronously, so they do not block your proxy requests.
### S3 Example
Add `audit_log_callbacks` and `s3_callback_params` to your `litellm_settings`:
```yaml
litellm_settings:
store_audit_logs: true
audit_log_callbacks: ["s3_v2"]
s3_callback_params:
s3_bucket_name: my-audit-logs-bucket # AWS Bucket Name
s3_region_name: us-west-2 # AWS Region
s3_aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID
s3_aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY
s3_path: litellm-audit # [OPTIONAL] prefix path in the bucket
```
Audit logs are written as JSON files to:
```
s3://<bucket>/audit_logs/<YYYY-MM-DD>/<HH-MM-SS>_<audit-log-id>.json
# or, when s3_path is set:
s3://<bucket>/<s3_path>/audit_logs/<YYYY-MM-DD>/<HH-MM-SS>_<audit-log-id>.json
```
:::info
Both `store_audit_logs: true` and `audit_log_callbacks` must be set. If `store_audit_logs` is not enabled, the callbacks will not fire.
:::
## Advanced
### Attribute Management changes to Users