Skip to main content

Crate phoxia_auditlog

Crate phoxia_auditlog 

Source
Expand description

phoxia-auditlog — Automatic audit logging for Axum apps.

§Quick start

use phoxia_auditlog::{AuditLayer, AuditConfig};
use sqlx::PgPool;

let pool = PgPool::connect("postgres://...").await?;
let config = AuditConfig::new(pool, "my-service");
let (layer, _ctx) = AuditLayer::new(config);
// Add `layer` to your Axum router with `.layer(layer)`

Re-exports§

pub use auditable::Auditable;
pub use config::AuditConfig;
pub use context::AuditContext;
pub use event::AuditEvent;
pub use layer::AuditLayer;
pub use chrono;
pub use serde_json;

Modules§

auditable
config
context
event
layer
service
writer

Macros§

audit
Log an explicit audit event from a handler.
audit_diff
Log an audit event with before/after diff of a mutated value.