pub struct StructuredAuditLogger;Expand description
Audit logger that emits structured log records via tracing.
Successful operations are logged at INFO level; failures at WARN level.
All fields of the AuditEntry are included as tracing fields so that
log aggregators (Loki, Elasticsearch, Splunk, etc.) can filter and query them.
This is the default logger used when init_audit_logger is never called.
For production compliance requirements, consider a database-backed logger.
Implementations§
Trait Implementations§
Source§impl AuditLogger for StructuredAuditLogger
impl AuditLogger for StructuredAuditLogger
Source§fn log_entry(&self, entry: AuditEntry)
fn log_entry(&self, entry: AuditEntry)
Log an audit entry Read more
Source§fn log_success(
&self,
event_type: AuditEventType,
secret_type: SecretType,
subject: Option<String>,
operation: &str,
)
fn log_success( &self, event_type: AuditEventType, secret_type: SecretType, subject: Option<String>, operation: &str, )
Convenience method for successful operations
Source§fn log_failure(
&self,
event_type: AuditEventType,
secret_type: SecretType,
subject: Option<String>,
operation: &str,
error: &str,
)
fn log_failure( &self, event_type: AuditEventType, secret_type: SecretType, subject: Option<String>, operation: &str, error: &str, )
Convenience method for failed operations
Auto Trait Implementations§
impl Freeze for StructuredAuditLogger
impl RefUnwindSafe for StructuredAuditLogger
impl Send for StructuredAuditLogger
impl Sync for StructuredAuditLogger
impl Unpin for StructuredAuditLogger
impl UnsafeUnpin for StructuredAuditLogger
impl UnwindSafe for StructuredAuditLogger
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more