#[non_exhaustive]pub struct AuditLog { /* private fields */ }Expand description
Append-only structured log that writes JSON lines to a file.
Supports automatic log rotation: when the file exceeds 10 MB,
existing logs are rotated ({name}.1 through {name}.5) and
a fresh file is started.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Create a new audit log at the given path. Create a new audit log writing to the given file path.
Sourcepub fn record(&self, entry: &AuditEntry) -> Result<(), AuditError>
pub fn record(&self, entry: &AuditEntry) -> Result<(), AuditError>
Record an audit entry by appending a JSON line. Query parameter values in the URL are redacted before logging. If the log file exceeds 10 MB, it is rotated first.
Auto Trait Implementations§
impl !Freeze for AuditLog
impl RefUnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl UnwindSafe for AuditLog
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