Skip to content

Home > @opengovsg/logging > AuditLogger

AuditLogger interface ​

The fixed-shape **audit** helper layer — logger.audit.<category>.<event>(…).

Each method records one auditable business event from a closed, governed taxonomy (ADR-0007). Unlike the free-form base logger, every event has a *fixed, type-enforced shape*: required fields are mandatory at compile time, shared identity is read from the bound scope, and the helper stamps the Controlled wire fields audit, category, and event.

The helper performs **no value transformation**: secrets are kept out *by shape* (they are never fields) and PII is left to the sink. See ADR-0007.

Signature:

typescript
export interface AuditLogger

Properties ​

PropertyModifiersTypeDescription
apiUsageApiUsageAuditAPI usage events — token lifecycle and sensitive-endpoint access.
authnAuthnAuditAuthentication & session events.
configChangeConfigChangeAuditApplication function & security-configuration change events.
dataAccessDataAccessAuditData access, movement & export events.
failuresFailuresAuditSecurity failures — handled, security-relevant denials.
resourceResourceAuditResource/entity lifecycle — create, update, delete, ownership transfer.
userManagementUserManagementAuditUser & permission management events.