pub struct AccessLog { /* private fields */ }Expand description
Buffered emitter. Per-handler call sites push entries via
AccessLog::record; a background task drains the buffer and writes
one S3 object per flush window.
Implementations§
Source§impl AccessLog
impl AccessLog
pub fn new(dest: AccessLogDest) -> Self
Sourcepub fn with_hmac_key(self, key: Arc<AuditHmacKey>) -> Self
pub fn with_hmac_key(self, key: Arc<AuditHmacKey>) -> Self
v0.5 #31: turn on tamper-evident HMAC chaining. Every emitted
line gets a trailing hex HMAC column, and each new batch file
starts with a # prev_file_tail=<hex> comment so the chain
extends across rotations. Without this builder, lines are
emitted exactly as before (back-compat with v0.4 #20 readers).
pub async fn record(&self, entry: AccessLogEntry)
Sourcepub fn spawn_flusher(&self) -> JoinHandle<()>
pub fn spawn_flusher(&self) -> JoinHandle<()>
Spawn the background flusher. Drains the buffer every
flush_every_secs (default 60) and appends to the per-hour file
in dest.dir. Returns the tokio JoinHandle so the caller can
abort on shutdown if needed.
Auto Trait Implementations§
impl Freeze for AccessLog
impl !RefUnwindSafe for AccessLog
impl Send for AccessLog
impl Sync for AccessLog
impl Unpin for AccessLog
impl UnsafeUnpin for AccessLog
impl !UnwindSafe for AccessLog
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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