SecureLogger

Struct SecureLogger 

Source
pub struct SecureLogger { /* private fields */ }
Expand description

Thread-safe secure logger for financial systems

Implementations§

Source§

impl SecureLogger

Source

pub fn new() -> Self

Create a new secure logger instance

Source

pub fn with_source(source: impl Into<String>) -> Self

Create a logger with a source identifier (hostname, service name)

Source

pub fn info(&self, message: impl Into<String>)

Log an informational message

Source

pub fn warning(&self, message: impl Into<String>)

Log a warning

Source

pub fn security_event( &self, message: impl Into<String>, metadata: Option<Value>, )

Log a security event with optional metadata

Source

pub fn critical(&self, message: impl Into<String>, metadata: Option<Value>)

Log a critical security incident

Source

pub fn audit(&self, message: impl Into<String>, metadata: Option<Value>)

Log an audit trail entry (for financial transactions, access control, etc.)

Source

pub fn log_with_category( &self, level: SecurityLevel, message: impl Into<String>, metadata: Option<Value>, category: impl Into<String>, )

Log with category

Source

pub fn get_entries(&self) -> Vec<LogEntry>

Get all log entries (read-only)

Source

pub fn get_entries_by_level(&self, level: SecurityLevel) -> Vec<LogEntry>

Get entries filtered by security level

Source

pub fn get_entries_by_category(&self, category: &str) -> Vec<LogEntry>

Get entries by category

Source

pub fn verify_all_integrity(&self) -> bool

Verify integrity of all log entries

Source

pub fn export_json(&self) -> Result<String, Error>

Export logs as JSON

Source

pub fn export_cef(&self) -> Vec<String>

Export logs in CEF format (for ArcSight)

Source

pub fn export_leef(&self) -> Vec<String>

Export logs in LEEF format (for QRadar)

Source

pub fn export_syslog(&self) -> Vec<String>

Export logs in Syslog format

Source

pub fn export_splunk(&self) -> Vec<String>

Export logs in Splunk HEC format

Source

pub fn count_by_level(&self, level: SecurityLevel) -> usize

Get count of entries by security level

Source

pub fn get_entries_by_date_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<LogEntry>

Get entries within a date range

Source

pub fn clear(&self)

Clear all log entries (use with caution - breaks audit trail)

Source

pub fn get_recent_entries(&self, count: usize) -> Vec<LogEntry>

Get the most recent N entries

Source

pub fn search(&self, query: &str) -> Vec<LogEntry>

Search log entries by message content

Source

pub fn get_statistics(&self) -> LogStatistics

Get statistics about log entries

Source

pub fn generate_sox_report( &self, period_start: DateTime<Utc>, period_end: DateTime<Utc>, ) -> ComplianceReport

Generate SOX compliance report

Source

pub fn generate_pci_report( &self, period_start: DateTime<Utc>, period_end: DateTime<Utc>, ) -> ComplianceReport

Generate PCI-DSS compliance report

Source

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

Source§

fn clone(&self) -> SecureLogger

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for SecureLogger

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.