pub struct SecureLogger { /* private fields */ }Expand description
Thread-safe secure logger for financial systems
Implementations§
Source§impl SecureLogger
impl SecureLogger
Sourcepub fn with_source(source: impl Into<String>) -> Self
pub fn with_source(source: impl Into<String>) -> Self
Create a logger with a source identifier (hostname, service name)
Sourcepub fn security_event(
&self,
message: impl Into<String>,
metadata: Option<Value>,
)
pub fn security_event( &self, message: impl Into<String>, metadata: Option<Value>, )
Log a security event with optional metadata
Sourcepub fn critical(&self, message: impl Into<String>, metadata: Option<Value>)
pub fn critical(&self, message: impl Into<String>, metadata: Option<Value>)
Log a critical security incident
Sourcepub fn audit(&self, message: impl Into<String>, metadata: Option<Value>)
pub fn audit(&self, message: impl Into<String>, metadata: Option<Value>)
Log an audit trail entry (for financial transactions, access control, etc.)
Sourcepub fn log_with_category(
&self,
level: SecurityLevel,
message: impl Into<String>,
metadata: Option<Value>,
category: impl Into<String>,
)
pub fn log_with_category( &self, level: SecurityLevel, message: impl Into<String>, metadata: Option<Value>, category: impl Into<String>, )
Log with category
Sourcepub fn get_entries(&self) -> Vec<LogEntry>
pub fn get_entries(&self) -> Vec<LogEntry>
Get all log entries (read-only)
Sourcepub fn get_entries_by_level(&self, level: SecurityLevel) -> Vec<LogEntry>
pub fn get_entries_by_level(&self, level: SecurityLevel) -> Vec<LogEntry>
Get entries filtered by security level
Sourcepub fn get_entries_by_category(&self, category: &str) -> Vec<LogEntry>
pub fn get_entries_by_category(&self, category: &str) -> Vec<LogEntry>
Get entries by category
Sourcepub fn verify_all_integrity(&self) -> bool
pub fn verify_all_integrity(&self) -> bool
Verify integrity of all log entries
Sourcepub fn export_json(&self) -> Result<String, Error>
pub fn export_json(&self) -> Result<String, Error>
Export logs as JSON
Sourcepub fn export_cef(&self) -> Vec<String>
pub fn export_cef(&self) -> Vec<String>
Export logs in CEF format (for ArcSight)
Sourcepub fn export_leef(&self) -> Vec<String>
pub fn export_leef(&self) -> Vec<String>
Export logs in LEEF format (for QRadar)
Sourcepub fn export_syslog(&self) -> Vec<String>
pub fn export_syslog(&self) -> Vec<String>
Export logs in Syslog format
Sourcepub fn export_splunk(&self) -> Vec<String>
pub fn export_splunk(&self) -> Vec<String>
Export logs in Splunk HEC format
Sourcepub fn count_by_level(&self, level: SecurityLevel) -> usize
pub fn count_by_level(&self, level: SecurityLevel) -> usize
Get count of entries by security level
Sourcepub fn get_entries_by_date_range(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<LogEntry>
pub fn get_entries_by_date_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<LogEntry>
Get entries within a date range
Sourcepub fn get_recent_entries(&self, count: usize) -> Vec<LogEntry>
pub fn get_recent_entries(&self, count: usize) -> Vec<LogEntry>
Get the most recent N entries
Sourcepub fn get_statistics(&self) -> LogStatistics
pub fn get_statistics(&self) -> LogStatistics
Get statistics about log entries
Sourcepub fn generate_sox_report(
&self,
period_start: DateTime<Utc>,
period_end: DateTime<Utc>,
) -> ComplianceReport
pub fn generate_sox_report( &self, period_start: DateTime<Utc>, period_end: DateTime<Utc>, ) -> ComplianceReport
Generate SOX compliance report
Sourcepub fn generate_pci_report(
&self,
period_start: DateTime<Utc>,
period_end: DateTime<Utc>,
) -> ComplianceReport
pub fn generate_pci_report( &self, period_start: DateTime<Utc>, period_end: DateTime<Utc>, ) -> ComplianceReport
Generate PCI-DSS compliance report
Sourcepub fn generate_glba_report(
&self,
period_start: DateTime<Utc>,
period_end: DateTime<Utc>,
) -> ComplianceReport
pub fn generate_glba_report( &self, period_start: DateTime<Utc>, period_end: DateTime<Utc>, ) -> ComplianceReport
Generate GLBA compliance report
Trait Implementations§
Source§impl Clone for SecureLogger
impl Clone for SecureLogger
Source§fn clone(&self) -> SecureLogger
fn clone(&self) -> SecureLogger
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more