pub struct LogAudit;Available on crate feature
monitor-tracing only.Expand description
AuditSink implementation that emits structured tracing events.
Construct with LogAudit::new; stateless and cheap to clone.
Each emitted event becomes a tracing log entry at info! level
with structured fields suitable for filtering in
tracing-subscriber.
§Examples
use key_vault::{KeyVaultBuilder, LogAudit};
let _vault = KeyVaultBuilder::new()
.with_audit_sink(LogAudit::new())
.build();Implementations§
Trait Implementations§
Source§impl AuditSink for LogAudit
impl AuditSink for LogAudit
Source§fn on_event(&self, event: &AuditEvent)
fn on_event(&self, event: &AuditEvent)
Receive one audit event. The sink may inspect any field but
must not mutate the event (it is passed by reference).
Source§fn is_no_op(&self) -> bool
fn is_no_op(&self) -> bool
Hot-path optimization hook: a sink that returns
true here
declares that it will discard every event without inspecting
any field. The vault uses this to skip AuditEvent
construction entirely on the hot path, avoiding one String
allocation per with_key / fragment / defragment call. Read moreimpl Copy for LogAudit
Auto Trait Implementations§
impl Freeze for LogAudit
impl RefUnwindSafe for LogAudit
impl Send for LogAudit
impl Sync for LogAudit
impl Unpin for LogAudit
impl UnsafeUnpin for LogAudit
impl UnwindSafe for LogAudit
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