docs: add audit log export to S3 documentation

This commit is contained in:
Ryan Crabbe 2026-03-23 22:46:38 -07:00
parent fb92ea21bc
commit 57c027a2dc

View file

@ -56,6 +56,38 @@ 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>/<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