pub struct AuditConfig {
pub min_level: AuditLevel,
pub include_debug: bool,
pub max_payload_size: usize,
pub redact_sensitive: bool,
pub redact_fields: Vec<String>,
pub enabled: bool,
pub buffer_size: usize,
pub flush_interval_secs: u64,
}Expand description
Configuration for audit logging.
Fields§
§min_level: AuditLevelMinimum level to log (events below this are filtered)
include_debug: boolWhether to include debug information
max_payload_size: usizeMaximum size for parameter/result payloads (bytes)
redact_sensitive: boolWhether to redact sensitive fields
redact_fields: Vec<String>Fields to redact
enabled: boolWhether audit logging is enabled
buffer_size: usizeBuffer size for async logging
flush_interval_secs: u64Flush interval in seconds
Implementations§
Source§impl AuditConfig
impl AuditConfig
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a development configuration with debug enabled.
Sourcepub fn production() -> Self
pub fn production() -> Self
Create a production configuration with stricter settings.
Sourcepub fn with_min_level(self, level: AuditLevel) -> Self
pub fn with_min_level(self, level: AuditLevel) -> Self
Set the minimum log level.
Sourcepub fn with_debug(self, include: bool) -> Self
pub fn with_debug(self, include: bool) -> Self
Enable or disable debug information.
Sourcepub fn with_max_payload_size(self, size: usize) -> Self
pub fn with_max_payload_size(self, size: usize) -> Self
Set maximum payload size.
Sourcepub fn with_redaction(self, enabled: bool) -> Self
pub fn with_redaction(self, enabled: bool) -> Self
Enable or disable sensitive field redaction.
Sourcepub fn with_redact_fields(self, fields: Vec<String>) -> Self
pub fn with_redact_fields(self, fields: Vec<String>) -> Self
Add fields to redact.
Sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Set buffer size.
Sourcepub fn should_log(&self, level: AuditLevel) -> bool
pub fn should_log(&self, level: AuditLevel) -> bool
Check if an event should be logged based on level.
Trait Implementations§
Source§impl Clone for AuditConfig
impl Clone for AuditConfig
Source§fn clone(&self) -> AuditConfig
fn clone(&self) -> AuditConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditConfig
impl Debug for AuditConfig
Auto Trait Implementations§
impl Freeze for AuditConfig
impl RefUnwindSafe for AuditConfig
impl Send for AuditConfig
impl Sync for AuditConfig
impl Unpin for AuditConfig
impl UnsafeUnpin for AuditConfig
impl UnwindSafe for AuditConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more