Skip to main content

Module audit

Module audit 

Source
Expand description

The audit log: one record per request, written in the same transaction as the change it describes. A record holds no vCon content, no token and no client address.

Structs§

AuditQuery
What an audit read asks for: at most limit records after the seq after, oldest first.
Entry
One request, as recorded.

Enums§

Action
What a request asked for. A refused request records what it asked for.
Actor
Who made a request.
AuditError
Why a record could not be written or exported.

Constants§

NO_ANSWER
The status of a record that answers no request, such as a listener that filled. No HTTP status is 0. The number is an entry’s only: the log’s column holds NULL for it (stored), and a record read back (export, page) has null there. Catalogs before schema version 5 held the number, and the upgrade to 5 replaces it.
SCHEMA
The audit table, part of every catalog that holds a log.

Functions§

count
Adds one to the record for this actor, action and status in the minute of now, making it if needed. For requests that could otherwise grow a log one row each: failed authentications and health checks.
count_many
Adds times to the record for this actor, action and status in the minute of now, making it if needed: count for what was added up before it is written, so that many requests cost one write.
export
Writes every record after since as JSON lines, oldest first.
page
Writes at most query.limit records after query.after as JSON lines, oldest first: the first lines export writes from the same place.
record
Appends one record, at now, in tx.