mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
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:
commit
764b96b1aa
1 changed files with 34 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue