1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Audit Logging System
//!
//! A decoupled audit logging system for tracking all gateway operations.
//!
//! # Features
//!
//! - **Request/Response Logging**: Log all API requests and responses
//! - **User Action Tracking**: Track user actions and authentication events
//! - **Multiple Outputs**: Support for file, database, and custom outputs
//! - **Async Non-blocking**: All logging operations are async
//! - **Configurable Retention**: Control log retention policies
//!
//! # Architecture
//!
//! The audit logging system follows these principles:
//! - **Decoupled**: Logging is independent of business logic
//! - **Extensible**: Easy to add new output targets via the `AuditOutput` trait
//! - **Performant**: Non-blocking async operations
//! - **Structured**: All logs are structured JSON for easy querying
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use litellm_rs::core::audit::{AuditLogger, AuditConfig, AuditEvent};
//!
//! let config = AuditConfig::default()
//! .enable_file_output("./logs/audit.log")
//! .enable_request_logging(true);
//!
//! let logger = AuditLogger::new(config).await?;
//!
//! // Log an event
//! logger.log(AuditEvent::request_started("req-123", "/v1/chat/completions")).await;
//! ```
// Re-export main types
pub use AuditConfig;
pub use ;
pub use AuditLogger;
pub use ;
pub use ;
pub use ;