Logs

What happened, told to whoever runs the app. Recorded with log().

Written with

Added with

npx prongs add logs

Domains

Intents

Domains

Audit

audit.*

Who did what, kept as a record: things created, changed, deleted, and changes to access.

info5 intents

Security

security.*

Signals worth watching: failed sign-ins, bad tokens, rate limits, probing.

warn3 intents

Incident

incident.*

Something broke or degraded, and someone should look.

errorwarn2 intents

Job

job.*

Background work: syncs, backups, migrations, scheduled runs.

info2 intents

Debug

debug.*

Detail for working on the code, dropped in production.

debug1 intent

Recording one

log(intent, message, data?) writes one structured entry. Name what happened; the intent sets the level and whether it alerts. Read the guide.

TS
// Someone created something that matters later: an account, a page, an API key
log('audit.created', 'Page created', { pageId: 'p_123', by: 'u_42' });

// Someone changed something that matters: settings, a role, a published page
log('audit.changed', 'Page settings saved', { pageId: 'p_123', fields: 'theme' });

// Someone deleted something: a page, an account, content
log('audit.deleted', 'Page deleted', { pageId: 'p_123', by: 'u_42' });

// Someone signed in, the ordinary way
log('audit.signedin', 'Something happened', { });

// Someone signed out
log('audit.signedout', 'Something happened', { });

Looks

The levels log intents are built from. Change a level here and every entry built from it follows. Looks have no pages of their own; each is listed here with what it is built from and the intents built from it.

level.*

For registry authors

Starter intents. These are the intents prongs add logs puts in your registry. Change levels through the level.* intents, and point log() at your logger.