pub struct JsonFileLogger { /* private fields */ }Expand description
JSON file logger with rotation support.
Writes each audit event as a JSON line (JSONL format) with optional rotation.
Implementations§
Source§impl JsonFileLogger
impl JsonFileLogger
Sourcepub async fn new(
base_path: impl Into<PathBuf>,
config: AuditConfig,
rotation: RotationConfig,
) -> Result<Self, AuditError>
pub async fn new( base_path: impl Into<PathBuf>, config: AuditConfig, rotation: RotationConfig, ) -> Result<Self, AuditError>
Create a new JSON file logger.
Trait Implementations§
Source§impl AuditLogger for JsonFileLogger
impl AuditLogger for JsonFileLogger
Source§fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log an audit event.
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flush any buffered events.
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the logger is healthy.
Auto Trait Implementations§
impl !Freeze for JsonFileLogger
impl !RefUnwindSafe for JsonFileLogger
impl Send for JsonFileLogger
impl Sync for JsonFileLogger
impl Unpin for JsonFileLogger
impl UnsafeUnpin for JsonFileLogger
impl UnwindSafe for JsonFileLogger
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